# Fibre > Sandboxes for agents and the code they write: start one, run commands in it, let it sleep with its memory and wake on the next call. - [Introduction](https://docs.fibre.dev/index.md): Fibre gives every AI agent, user and task its own Linux machine in one API call. It sleeps with its memory when work stops and wakes exactly where it was, so you pay only for the seconds it works. - [Quickstart](https://docs.fibre.dev/get-started/quickstart.md): Your first sandbox in four steps: get a key, start a sandbox, run code in it, then let it sleep or delete it. - [Concepts](https://docs.fibre.dev/get-started/concepts.md): Every word the Fibre docs use, defined once: sandbox, size, runtime, image, snapshot, exec and commands, sleep and wake, lifetime, labels, address, API key. - [API keys](https://docs.fibre.dev/get-started/api-keys.md): Every request carries an API key. Create one, limit it to some areas, to one sandbox or to a lifetime, list and revoke keys, and what each error means. - [Pricing and limits](https://docs.fibre.dev/get-started/pricing.md): What a sandbox costs per awake hour at each size, a worked monthly cost, the plans, the free trial, and the main limits. - [Create and configure](https://docs.fibre.dev/sandboxes/overview.md): Start a sandbox for a user, a task or a conversation: pick its size, image and environment, tag it so you can find it again, retry safely, update it and delete it. - [Run commands](https://docs.fibre.dev/sandboxes/running-commands.md): Run a command and wait for its output, or start it in the background: stream its output live, feed it input, stop it with a signal, or keep a server running across sleep. - [Files](https://docs.fibre.dev/sandboxes/files.md): Get code and data into a sandbox and results out of it: write, read, list, inspect and delete files over the API, any size, text or binary, without a shell. - [Sleep, wake and lifetime](https://docs.fibre.dev/sandboxes/sleep-and-wake.md): An idle sandbox sleeps with its memory and wakes on the next call, with its programs, data and open files where they were. What is kept, what wakes it, how to tune it, and what it costs. - [Runtimes: standard and VM](https://docs.fibre.dev/sandboxes/runtimes.md): Two ways a sandbox can run: standard for code, tools and browsers; vm, a full virtual machine with its own kernel, for Docker, systemd and kernel features. Same calls, same price. - [Sizes and what is installed](https://docs.fibre.dev/sandboxes/sizes.md): The four sandbox sizes with their CPU, memory, disk and price; what Fibre's default image has installed; how to install more, and how to bring your own image. - [Public URLs and ports](https://docs.fibre.dev/connect/public-urls.md): Every sandbox has its own HTTPS address. Serve an app, an API or a preview from it, share the link, and let it sleep: the next visitor wakes it with the app still running. - [Browser](https://docs.fibre.dev/connect/browser.md): A real Chromium in every sandbox: drive it with Playwright or Puppeteer from inside the sandbox or from your own code, watch it live, and keep its tabs and logins across sleep. - [Desktop](https://docs.fibre.dev/connect/desktop.md): A full Linux desktop with a browser, a terminal and VS Code, that a person watches in their own browser and an agent drives with screenshots, clicks and keys. For computer-use agents and apps that have no API. - [Use sandboxes from a web app](https://docs.fibre.dev/connect/web-apps.md): Let the people using your web app run code, preview apps and watch agents in Fibre sandboxes, while your API key stays on your server: the pattern, a small server in TypeScript and Python, previews in a page, live output and CORS. - [Snapshots](https://docs.fibre.dev/setup/snapshots.md): Set a sandbox up once (dependencies installed, data loaded, servers running), take a snapshot of its whole state with its memory, and start as many sandboxes from it as you need, each already running and ready to work. - [Images and builds](https://docs.fibre.dev/setup/images.md): Choose what a sandbox starts from: Fibre's default image, any public image, an image you build on Fibre from a Dockerfile, or an image from your own registry. - [Private registries](https://docs.fibre.dev/setup/registries.md): Store a registry login once, then start sandboxes from your private images on GitHub, Docker Hub or your own registry, without putting credentials in every request. - [Webhooks](https://docs.fibre.dev/production/webhooks.md): Get a signed HTTP request when a sandbox is ready, goes to sleep, crashes or is deleted, and when a build finishes, instead of polling. Verify the signature, handle retries, test and inspect deliveries. - [Secrets](https://docs.fibre.dev/production/secrets.md): Store API keys, tokens and passwords once, encrypted, and give them to sandboxes by name: to the one command that needs a secret, or to every command in a sandbox. Values are never shown again. - [Network access](https://docs.fibre.dev/production/network.md): Decide what a sandbox can reach on the internet: everything, only the sites you list, or nothing. Run untrusted or AI-generated code that can install packages but cannot send your data anywhere else. - [Security and isolation](https://docs.fibre.dev/production/security.md): What keeps one sandbox from another and from your account, how keys and secrets are handled, and the settings that make it safe to run untrusted and AI-generated code. - [Usage and billing](https://docs.fibre.dev/production/usage.md): Know what your sandboxes cost while they run: spend today, this month and projected, what is awake right now, your plan's limits, credit and balance, and every charge in the ledger. - [Errors, retries and limits](https://docs.fibre.dev/production/errors-and-limits.md): Handle Fibre's errors well in production: the error shape, which errors to retry and how, safe retries with idempotency keys, and every limit in one place. - [Best practices](https://docs.fibre.dev/production/best-practices.md): How to use Fibre well in production: one sandbox per unit of work, reused through sleep, with lifetimes, labels, safe retries, snapshots for fast starts, secrets by name, and nothing left running by accident. - [Use cases](https://docs.fibre.dev/use-cases/overview.md): Complete, runnable programs for the jobs developers use Fibre for: code interpreters, coding agents, parallel agents, a sandbox per user, previews, CI, evals and Docker environments. - [A code interpreter for your AI app](https://docs.fibre.dev/use-cases/run-code.md): Let a model write Python and run it safely: one sandbox per conversation, packages installed once, variables kept between turns, charts and files returned to your app. - [A coding agent on your repo](https://docs.fibre.dev/use-cases/coding-agent.md): Hand a failing test to Claude Code in a sandbox: it gets the repo, the tools and a shell of its own, fixes the bug, proves it with the tests, and you review the diff before anything leaves the sandbox. - [Many agents in parallel](https://docs.fibre.dev/use-cases/parallel.md): Prepare one sandbox, save it as a snapshot, and fan out: one copy per task, all running at once, each isolated, results collected at the end. For agents on many issues, sharded test suites and batch jobs. - [A sandbox per user](https://docs.fibre.dev/use-cases/sandbox-per-user.md): Give every user of your product their own sandbox: a workspace for their agent, their files and their running app. Three patterns with their monthly costs, the code to find or create a user's sandbox, and what to do when users come and go. - [Preview environments](https://docs.fibre.dev/use-cases/dev-server.md): A live preview of every branch or pull request: the app's dev server running in a sandbox, at its own HTTPS link, updating as code changes, asleep when nobody looks, and gone when the branch is merged. - [Tests and CI](https://docs.fibre.dev/use-cases/ci.md): Run a test suite in a fresh sandbox from any CI or script: send the code, stream the output live, fail the build on the exit code, and keep the sandbox around to debug a failure. - [Evals and RL](https://docs.fibre.dev/use-cases/evals.md): Score a model or an agent on many tasks: one identical, isolated environment per episode, all running in parallel, a checker that runs inside each, and the results collected into one table. - [Docker and Compose environments](https://docs.fibre.dev/use-cases/docker.md): Run Docker and Docker Compose inside a VM sandbox: a whole stack with a database, a cache and your app, for an agent to work against, for integration tests, or as a dev environment that sleeps with every container up. - [FAQ](https://docs.fibre.dev/help/faq.md): Short answers to the questions developers ask most about Fibre: what a sandbox is, sleep and cost, limits, security, agents, and how Fibre fits next to your own infrastructure. - [Troubleshooting](https://docs.fibre.dev/help/troubleshooting.md): The problems developers hit most, what causes each, and the fix: sandboxes that do not start, commands that stop, packages that will not install, servers that do not answer at their URL, and programs missing after a wake. - [SDKs](https://docs.fibre.dev/sdks/overview.md): Official Fibre clients: the TypeScript and Python SDKs and the CLI. Each wraps the HTTP API with typed calls, streaming, retries and errors you can catch. - [TypeScript SDK](https://docs.fibre.dev/sdks/typescript.md): Install the TypeScript SDK and use it by task: create sandboxes, run and stream commands, move files, serve apps, use snapshots and browsers, handle errors, and make any API call. - [Python SDK](https://docs.fibre.dev/sdks/python.md): Install the Python SDK and use it by task: create sandboxes, run and stream commands, move files, serve apps, use snapshots and browsers, work with asyncio, handle errors, and make any API call. - [CLI](https://docs.fibre.dev/sdks/cli.md): Use Fibre from your terminal: install one program, sign in, start sandboxes, run commands with their output live, open a shell, and copy files in and out. Every command also speaks JSON for scripts and agents. - [Give your coding agent sandboxes](https://docs.fibre.dev/build-with-ai/mcp-server.md): Add Fibre's MCP server to Claude Code, Codex, Cursor or OpenCode with one command, so your agent can run tests, builds, servers and untrusted code in sandboxes instead of on your machine. Add the Fibre skill so it knows when and how. - [Use Fibre from your coding agent](https://docs.fibre.dev/build-with-ai/coding-agents.md): Give Claude Code, Codex, Cursor or any other coding agent the Fibre docs, so it can write Fibre code for you: an MCP server to search them, an index written for language models, a Markdown copy of every page, and a prompt to paste. - [Claude Code in a sandbox](https://docs.fibre.dev/build-with-ai/claude-code.md): Install Claude Code in a Fibre sandbox, give it a repository, run a task headless, read what it changed, and come back to the same session later. - [Codex in a sandbox](https://docs.fibre.dev/build-with-ai/codex.md): Install OpenAI's Codex CLI in a Fibre sandbox, run a task on a repository with codex exec, read the result, and resume the same session later. - [OpenCode in a sandbox](https://docs.fibre.dev/build-with-ai/opencode.md): Install OpenCode in a Fibre sandbox, run a task on a repository with opencode run and the model of your choice, and continue the session later. - [An agent built on the Claude Agent SDK](https://docs.fibre.dev/build-with-ai/claude-agent-sdk.md): Run your own agent, written with Anthropic's Claude Agent SDK, inside a Fibre sandbox, and let the sandbox's sleep keep its session between tasks. - [A sandbox tool for your agent framework](https://docs.fibre.dev/build-with-ai/agent-frameworks.md): Give an agent built with the AI SDK, OpenAI Agents or any framework one tool that runs its commands in a Fibre sandbox, one sandbox per conversation. - [API reference](https://docs.fibre.dev/api-reference/introduction.md): The Fibre HTTP API: base URL, authentication, request and response formats, status codes, errors, safe retries, pagination and streaming. Every endpoint has its own page with a live playground. - [Errors](https://docs.fibre.dev/api-reference/errors.md): Every error code the Fibre API answers with: its HTTP status, what it means, and what to do. - [Create a sandbox](https://docs.fibre.dev/api-reference/sandboxes/create-a-sandbox.md): Start a sandbox and answer once it is running. With no body, it runs Fibre's default image on the `standard` runtime and can run commands at once. - [List sandboxes](https://docs.fibre.dev/api-reference/sandboxes/list-sandboxes.md): Your sandboxes, newest first, asleep or awake. Filter by labels with `label.=` (several narrow the list). When there are more than `limit`, the answer has `next_cursor`: pass it as `cursor` for the next page. - [Get a sandbox](https://docs.fibre.dev/api-reference/sandboxes/get-a-sandbox.md): One sandbox. Reading a sleeping sandbox does not wake it: its `status` is `standby`. - [Update a sandbox](https://docs.fibre.dev/api-reference/sandboxes/update-a-sandbox.md): Change what can change while a sandbox lives: its lifetime (counted from now, or `null` to remove it so the sandbox is kept until deleted), its idle timeout, and its labels (the whole set is replaced). - [Delete a sandbox](https://docs.fibre.dev/api-reference/sandboxes/delete-a-sandbox.md): Delete a sandbox, its files and its saved memory. This cannot be undone. - [Run a command](https://docs.fibre.dev/api-reference/sandboxes/run-a-command.md): Run a command and wait for it, up to 30 seconds, keeping at most 4 MB of each output stream. A sleeping sandbox is woken first. A non-zero `exit_code` is a result, not an error. For longer commands, input or streaming, use [Start a command](/api-reference/commands/start-a-command). - [Start a command](https://docs.fibre.dev/api-reference/commands/start-a-command.md): Start a command in the background and answer at once with its status. It runs until it ends, is killed, or reaches `timeout_sec`; a running command keeps the sandbox awake. With `stdin: true` you can write to it; with `keep: true` it runs on its own and carries on across sleep (status `detached`, ou… - [List commands](https://docs.fibre.dev/api-reference/commands/list-commands.md): The commands of the sandbox's current awake period, oldest first. After a sleep they are gone. - [Get a command](https://docs.fibre.dev/api-reference/commands/get-a-command.md): A command's status and exit code. - [Read a command's output](https://docs.fibre.dev/api-reference/commands/read-a-commands-output.md): The command's output as newline-delimited JSON: one object per piece of output (`stream`, `offset`, `data`; `encoding: "base64"` when not UTF-8), then `{"event": "end", "status", "exit_code"}` once it has ended. With `follow=1` the answer stays open and streams output as it is written. Start from `s… - [Write to a command](https://docs.fibre.dev/api-reference/commands/write-to-a-command.md): Write the request body, as it is, to the command's standard input (up to 8 MB per call). The command must have been started with `stdin: true`. - [Close a command's input](https://docs.fibre.dev/api-reference/commands/close-a-commands-input.md): Close the command's standard input: it reads end-of-file. - [Stop a command](https://docs.fibre.dev/api-reference/commands/stop-a-command.md): Send a signal to the command and every process it started (`TERM` unless you choose another), then `KILL` to whatever is left after `grace_s` seconds (5). - [List a directory](https://docs.fibre.dev/api-reference/files/list-a-directory.md): One level of a directory: each entry's name, type, size, mode, time and owner. - [Delete a file](https://docs.fibre.dev/api-reference/files/delete-a-file.md): Delete a file, or a directory with `recursive=true`. - [Inspect a file](https://docs.fibre.dev/api-reference/files/inspect-a-file.md): One file or directory: type, size, mode, time; with `checksum=sha256`, its hash. - [Read a file](https://docs.fibre.dev/api-reference/files/read-a-file.md): The file's bytes, as the response body. - [Write a file](https://docs.fibre.dev/api-reference/files/write-a-file.md): Write the request body to the file, creating missing directories and replacing a file already there. Any content, as large as the sandbox's free disk. - [Get browser links](https://docs.fibre.dev/api-reference/browser-and-desktop/get-browser-links.md): Start the sandbox's browser if needed and return two links: `cdp_url` for your code (a credential: keep it on your server) and `live_view_url` for a person to watch. They work for an hour, or `ttl_sec`. - [Close the browser](https://docs.fibre.dev/api-reference/browser-and-desktop/close-the-browser.md): Revoke every link to the browser, close their connections and stop the browser. The sandbox keeps running. - [Get a desktop link](https://docs.fibre.dev/api-reference/browser-and-desktop/get-a-desktop-link.md): A single-use link to watch and use the sandbox's desktop (a sandbox created with `needs: ["desktop"]`). It expires if nobody opens it within `expires_in` seconds. - [Take a snapshot](https://docs.fibre.dev/api-reference/snapshots/take-a-snapshot.md): Take a snapshot of a running sandbox: its files, memory and running programs. The source keeps running. New sandboxes start from it with `POST /v1/sandboxes {"snapshot": name}`. A snapshot is kept until deleted and counts toward the account's storage; the answer has its `size_bytes` and `monthly_cos… - [List snapshots](https://docs.fibre.dev/api-reference/snapshots/list-snapshots.md): Your account's snapshots, each with its size and what it costs a month. - [Get a snapshot](https://docs.fibre.dev/api-reference/snapshots/get-a-snapshot.md): One snapshot. - [Delete a snapshot](https://docs.fibre.dev/api-reference/snapshots/delete-a-snapshot.md): Delete a snapshot. Refused while sandboxes started from it still exist. - [Set a secret](https://docs.fibre.dev/api-reference/secrets/set-a-secret.md): Store a secret, encrypted: create it, or replace its value, which makes a new version. The value is never answered again, by this call or any other. Names are UPPER_SNAKE_CASE; values up to 65,536 characters. Give it to sandboxes by name with `secrets`, on [Start a command](/api-reference/commands/s… - [List secrets](https://docs.fibre.dev/api-reference/secrets/list-secrets.md): Your account's secrets: their names, versions and times, never their values. - [Get a secret](https://docs.fibre.dev/api-reference/secrets/get-a-secret.md): One secret's name, version and times (never its value). - [Delete a secret](https://docs.fibre.dev/api-reference/secrets/delete-a-secret.md): Delete a secret. Sandboxes that named it start without it from then on; commands that name it are refused. - [Create an API key](https://docs.fibre.dev/api-reference/api-keys/create-an-api-key.md): Create a key, limited to `scopes`, bound to one sandbox with `resource`, and expiring after `expires_in_sec`. The key is in the answer once; only a digest is kept. A key can create keys only with `keys.write`, and never one broader or longer-lived than itself. - [List API keys](https://docs.fibre.dev/api-reference/api-keys/list-api-keys.md): Your account's keys: name, prefix, scopes, binding, expiry and last use. Never the keys themselves. - [Revoke an API key](https://docs.fibre.dev/api-reference/api-keys/revoke-an-api-key.md): Revoke a key. It stops working at once. - [Create a webhook](https://docs.fibre.dev/api-reference/webhooks/create-a-webhook.md): Add an endpoint that receives signed `POST` requests for the `events` you choose (all of them if you leave it out). The signing `secret` is in the answer once. - [List webhooks](https://docs.fibre.dev/api-reference/webhooks/list-webhooks.md): Your account's webhook endpoints. - [Delete a webhook](https://docs.fibre.dev/api-reference/webhooks/delete-a-webhook.md): Remove an endpoint. Pending deliveries to it stop. - [Rotate a webhook secret](https://docs.fibre.dev/api-reference/webhooks/rotate-a-webhook-secret.md): A new signing secret, in the answer once. The old one keeps signing alongside it for 24 hours. - [Test a webhook](https://docs.fibre.dev/api-reference/webhooks/test-a-webhook.md): Send a `ping` event to the endpoint now. - [List deliveries](https://docs.fibre.dev/api-reference/webhooks/list-deliveries.md): The endpoint's last 50 deliveries, newest first: status, attempts, your server's last answer and error. - [List awake sandboxes](https://docs.fibre.dev/api-reference/billing/list-awake-sandboxes.md): The billing sessions open now: every sandbox awake and being charged. - [Get usage](https://docs.fibre.dev/api-reference/billing/get-usage.md): Awake hours and cost in a period, this month unless you pass `from` and `to`. - [Get spend](https://docs.fibre.dev/api-reference/billing/get-spend.md): Spend today, this week, this month, and this month's projection, in US dollars. - [Get the billing account](https://docs.fibre.dev/api-reference/billing/get-the-billing-account.md): Plan, status, credit, balance, auto top-up, limits, today's usage against them, and storage. - [List ledger entries](https://docs.fibre.dev/api-reference/billing/list-ledger-entries.md): Every charge and payment, newest first, with how much came from plan credit and how much from the balance. - [Start a checkout](https://docs.fibre.dev/api-reference/billing/start-a-checkout.md): A link to a checkout page to start or change a plan. - [Open the billing portal](https://docs.fibre.dev/api-reference/billing/open-the-billing-portal.md): A link to manage the card and download invoices. - [Add funds](https://docs.fibre.dev/api-reference/billing/add-funds.md): A link to a checkout page that adds money to the balance. - [Set auto top-up](https://docs.fibre.dev/api-reference/billing/set-auto-top-up.md): Turn automatic top-up on or off, with the balance that triggers it and the amount it adds. - [Get pricing](https://docs.fibre.dev/api-reference/pricing/get-pricing.md): Sizes with their CPU, memory, disk and price per awake hour; plans; the price above plan limits; storage. No key needed. ## OpenAPI Specs - [openapi](/api-reference/openapi.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.