Base URL
Use the local address during development and the hosted URL for production:| Environment | Base URL |
|---|---|
| Local dev | http://127.0.0.1:7070 |
| Hosted | https://api.podflare.dev |
Content types
- Requests:
application/json - Non-streaming responses:
application/json - Streaming responses (
/exec):application/x-ndjson— one JSON object per line, flushed as the sandbox produces it
Streaming event schema
The/exec endpoint streams events as NDJSON. Each line is one of the following event objects:
The event type. One of
stdout, stderr, or exit.For
stdout and stderr: one line of output text. For exit: the integer exit code of the process.Monotonically increasing counter scoped to the
exec call. Use this to reassemble events in order if they arrive out of sequence across transports.Host wall-clock timestamp in milliseconds since the Unix epoch.
Authentication
Pass your API key as a bearer token:Local development mode (connecting to
http://127.0.0.1:7070) does not require an API key. All hosted requests to https://api.podflare.dev require a valid key.Errors
All non-2xx responses return a JSON body with a singleerror field:
| Status | Meaning |
|---|---|
400 | Invalid request body — for example, fork called with n > 32 |
401 | Missing or invalid API key |
404 | Sandbox id not found |
500 | Executor error — Firecracker API failed, agent did not respond, etc. |
Endpoints
POST /v1/sandboxes
Create a new sandbox and return its id.
POST /v1/sandboxes/:id/exec
Execute code in a sandbox and stream output events.
POST /v1/sandboxes/:id/fork
Snapshot a sandbox and spawn N copy-on-write children.
POST /v1/sandboxes/:id/merge_into/:winner
Commit a fork child’s state as the parent’s new state.
DELETE /v1/sandboxes/:id
Destroy a sandbox and free its resources.