> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fibre.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Your first sandbox in four steps: get a key, start a sandbox, run code in it, then let it sleep or delete it.

This page takes you from nothing to a working sandbox in four short steps. You will create an API key, start a
sandbox, run a small Python program inside it, and then decide whether to keep it or delete it. It takes a few
minutes.

Every step shows the same thing four ways: with the **CLI**, the **TypeScript SDK**, the **Python SDK** and plain
**`curl`**, so you can follow along in whichever you prefer.

**1. Get an API key**

Every request to Fibre needs an API key, so that Fibre knows which account it is for.

Sign up at [fibre.dev](https://fibre.dev), open **API keys** in the dashboard, and create a key. It starts with
`fb_live_`. **Copy it straight away: it is shown only once.** Then make it available to your shell, together with
the address of the API:

```bash title="Terminal" norun reason="your own key goes here" theme={null}
export FIBRE_API_KEY="fb_live_…"
export FIBRE_API_URL="https://api.fibre.dev"
```

If you are using the CLI, install it; if you are using TypeScript or Python, add the SDK to your project. They all
read the same two variables, so there is nothing else to configure:

```bash title="CLI" norun reason="installs on your own machine" theme={null}
curl -fsSL https://fibre.dev/install.sh | sh
```

```bash title="TypeScript" norun reason="installs into your own project" theme={null}
npm install @fibre-dev/sdk
```

```bash title="Python" norun reason="installs into your own project" theme={null}
pip install fibre-sdk
```

**2. Start a sandbox**

```bash title="CLI" run theme={null}
SBX=$(fibre create --lifetime 10m --json | jq -r .id)
fibre get "$SBX"   # sbx-… running
```

```typescript title="TypeScript" run theme={null}
import { Sandbox } from "@fibre-dev/sdk";

const sbx = await Sandbox.create({ lifetime: 600 });
console.log(sbx.id, sbx.status); // sbx-… running
```

```python title="Python" run theme={null}
from fibre import Sandbox

sbx = Sandbox.create(lifetime=600)
print(sbx.id, sbx.status)  # sbx-… running
```

```bash title="curl" run capture=SBX=.id theme={null}
curl -sS -X POST "$FIBRE_API_URL/v1/sandboxes" \
  -H "Authorization: Bearer $FIBRE_API_KEY" -H "Content-Type: application/json" \
  -d '{"lifetime_sec": 600}'
```

> [accordion] Response
>
> ```json title="response" expected theme={null}
> {
>   "id": "…",
>   "status": "running",
>   "runtime": "standard"
> }
> ```

The call waits until the sandbox is running, then answers. There is no "pending" state to check on. The answer
includes the sandbox's `id` (it looks like `sbx-1a2b3c4d5e`). Keep it: every other call refers to the sandbox by
this ID.

Here is what you get when you leave the other options out:

| You get | |
| - | - |
| Image | Linux with a shell, Python, Node, git and a browser |
| Lifetime | 600 seconds, as asked (without one, it is kept until you delete it) |
| Sleep | After 5 minutes with nothing happening |

**3. Run code in it**

A sandbox is a full Linux machine, so you can put files in it and run programs, just as you would on your own
computer. Here we write a small Python script into the sandbox, then run it and read its output:

```bash title="CLI" run theme={null}
fibre exec "$SBX" -i -- sh -c 'cat > /tmp/hello.py' <<'PY'
import platform
print("hello from", platform.system())
PY
fibre exec "$SBX" -- python3 /tmp/hello.py   # hello from Linux
```

```typescript title="TypeScript" run theme={null}
await sbx.files.write("/tmp/hello.py", "import platform\nprint('hello from', platform.system())\n");
const result = await sbx.run(["python3", "/tmp/hello.py"]);
console.log(result.exitCode, result.stdout); // 0 hello from Linux
```

```python title="Python" run theme={null}
sbx.files.write("/tmp/hello.py", "import platform\nprint('hello from', platform.system())\n")
result = sbx.run(["python3", "/tmp/hello.py"])
print(result.exit_code, result.stdout)  # 0 hello from Linux
```

```bash title="curl" run theme={null}
printf 'import platform\nprint("hello from", platform.system())\n' | \
  curl -sS -o /dev/null -X PUT "$FIBRE_API_URL/v1/sandboxes/$SBX/files/content?path=/tmp/hello.py" \
  -H "Authorization: Bearer $FIBRE_API_KEY" --data-binary @-

curl -sS -X POST "$FIBRE_API_URL/v1/sandboxes/$SBX/exec" \
  -H "Authorization: Bearer $FIBRE_API_KEY" -H "Content-Type: application/json" \
  -d '{"command": ["python3", "/tmp/hello.py"]}'
```

> [accordion] Response
>
> ```json title="response" expected theme={null}
> {
>   "exit_code": 0,
>   "stdout": "hello from Linux\n"
> }
> ```

> [!TIP]
>
> This way of running a command (an *exec*) waits for the command to finish, and stops it if it takes longer than 30
> seconds. That is perfect for quick commands. For longer work such as installs, test runs and servers, use
> [background commands](https://docs.fibre.dev/sandboxes/running-commands.md) instead.

**4. Let it sleep, or delete it**

You do not need to stop a sandbox when you take a break. **If nothing happens in it for 5 minutes, it goes to
sleep on its own.** While it sleeps, its memory, programs and files are all kept, and you pay nothing for compute.
The next call you make to it wakes it up, exactly where it was.

When you have finished with the sandbox for good, delete it:

```bash title="CLI" run theme={null}
fibre delete "$SBX"
```

```typescript title="TypeScript" run theme={null}
await sbx.delete();
```

```python title="Python" run theme={null}
sbx.delete()
```

```bash title="curl" run theme={null}
curl -sS -X DELETE "$FIBRE_API_URL/v1/sandboxes/$SBX" -H "Authorization: Bearer $FIBRE_API_KEY"
```

> [accordion] Response
>
> ```json title="response" expected theme={null}
> {
>   "deleted": true
> }
> ```

If you forget to delete this one, it is deleted automatically when its lifetime ends, after 600 seconds. A sandbox
without a lifetime is kept until you delete it.

## Next

> [card] [Concepts](https://docs.fibre.dev/get-started/concepts.md)
>
> The words these docs use, each explained in a few lines.

> [card] [Run commands](https://docs.fibre.dev/sandboxes/running-commands.md)
>
> Run long commands, watch their output live, and keep programs running.

> [card] [Files](https://docs.fibre.dev/sandboxes/files.md)
>
> Move files and folders in and out of a sandbox.

> [card] [Secrets](https://docs.fibre.dev/production/secrets.md)
>
> Store API keys once and give them to the commands that need them.

> [card] [Give your agent sandboxes](https://docs.fibre.dev/build-with-ai/mcp-server.md)
>
> Add Fibre's MCP server to Claude Code, Codex, Cursor or OpenCode in one command.

> [card] [From your coding agent](https://docs.fibre.dev/build-with-ai/coding-agents.md)
>
> Let your agent read these docs and write the code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.