Skip to content

Using the API

Each region serves the API at its own address, ending in /v1, for example https://api.global.<domain>/v1. The full list of endpoints is in the API reference.

Create a key under API keys in the console (or stillbox keys create), and send it in every request:

Terminal window
curl -H "Authorization: Bearer $STILLBOX_API_KEY" https://api.global.example.com/v1/sandboxes

Keys belong to one organization and work only in their region. Never put a key inside a sandbox.

Terminal window
curl -X POST https://api.global.example.com/v1/sandboxes \
-H "Authorization: Bearer $STILLBOX_API_KEY" -H "Idempotency-Key: build-42" \
-d '{"image": "stillbox/claude-code:dev", "name": "Build 42"}'

The sandbox starts as pending and becomes running once a server has started it. Requests describe what you want and the platform makes it so, so repeating a request is safe; with an Idempotency-Key, a retried create returns the same sandbox.

Terminal window
curl -X POST https://api.global.example.com/v1/sandboxes/ws-.../exec \
-H "Authorization: Bearer $STILLBOX_API_KEY" -H "Accept: text/event-stream" \
-d '{"command": ["npm", "test"]}'

With Accept: text/event-stream, output streams as it happens (stdout and stderr events with base64 data, then an exit event); otherwise the call returns when the command finishes.

Each agent sandbox speaks the OpenAI Responses API, so any OpenAI SDK can talk to it. Point the SDK at the sandbox’s agent address and use your API key:

from openai import OpenAI
client = OpenAI(
base_url="https://api.global.example.com/v1/sandboxes/ws-7k2m9q4x8w3z5r6t/agent/v1",
api_key=STILLBOX_API_KEY,
)
first = client.responses.create(input="Clone github.com/me/app and run its tests")
again = client.responses.create(input="Now fix the failing one", previous_response_id=first.id)

Turns keep running if you disconnect; with stream=True, events carry IDs and GET .../conversations/{id}/events?after=N resumes from where you left off.

POST .../responses/{id}/cancel stops a turn. To change an agent’s course while it works, send the next message with interrupt: the running step stops, and your message continues the same conversation at once, marked for the agent as an interruption. Without interrupt, a message to a conversation that’s still working is refused (409).

client.responses.create(input="Use the staging database instead", previous_response_id=first.id,
extra_body={"interrupt": True})

The SDKs take it as chat(..., interrupt=True), the CLI as stillbox chat <id> --interrupt "...", and in the console’s chat you just send a message while the agent works.