Sandbox Mode
Run deterministic simulated requests in an explicitly enabled sandbox: no provider calls, no credits, no usage charges.
Overview
Sandbox Mode is a test environment on its own path, /v1/sandbox, served by the same API process. Requests sent there are answered with a fixed, simulated response. No upstream provider is called, so nothing is billed and no usage aggregate is changed. Sandbox calls still appear in the credit history, marked as sandbox and costed at zero.
The sandbox accepts any model name on its own path: the path selects the simulation, not the model. The response echoes the requested model, so SDK code that compares response.model keeps working. aether-sandbox is the canonical test model advertised by GET /v1/sandbox/models, but names such as gpt-4o or your own production model are simulated too. Missing or empty model names return 400. A plain text request always receives [Aether Sandbox] Simulated response. No provider was called.; tool and schema requests follow the deterministic rules under Tools and structured output. Every counter in usage is 0.
Deterministic, not qualitative
The sandbox exercises request handling, error paths, retry logic, and streaming plumbing. It does not produce model quality: the simulated answer never depends on your prompt.Enable the sandbox
The sandbox is mounted only when the server environment variable AETHER_SANDBOX_ENABLED=true is set. This is a server-side switch: a request, API key, or header cannot turn it on. While it is off, every sandbox route answers 503 with code sandbox_disabled.
Authentication
Sandbox requests authenticate exactly like production requests: Authorization: Bearer sk-aetherapi-..., or the Anthropic-style x-api-key header on /v1/sandbox/messages. The same API key, account, project, and model-access checks apply. Only billing is skipped — the sandbox path needs no credit balance.
Endpoints
https://api.aetherapi.dev/v1/sandbox/modelshttps://api.aetherapi.dev/v1/sandbox/chat/completionshttps://api.aetherapi.dev/v1/sandbox/responseshttps://api.aetherapi.dev/v1/sandbox/messagesGET /v1/sandbox/models returns the canonical sandbox model, aether-sandbox; the three POST routes accept any model name and echo it back. They mirror the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages protocols and return their native response shapes, including on the streaming path.
Request options
modelstringrequired- Any non-empty model name (max 200 characters). It is simulated and echoed back; aether-sandbox is the canonical test model.
messagesarrayrequired- Chat Completions and Messages message array. The Responses endpoint takes input instead.
streamboolean- If true, the response is sent as Server-Sent Events. Default: false
sandboxobject- Sandbox options. Accepts scenario, delay_ms and, for a new tool call, tool_arguments; any other key returns 400.
tools / tool_choicearray / string | object- Client function tools in the endpoint's own shape. The sandbox returns exactly one call and never executes it.
response_formatobject- Chat only: json_schema output within the supported subset. Responses uses text.format, Messages output_config.format.
sandbox.scenariostring- One of success, rate_limit, timeout, provider_unavailable, stream_error. Default: success
sandbox.delay_msinteger- Artificial delay before the response, 0 to 5000 ms. Default: 0, or 250 for timeout
Example request
cURL
curl https://api.aetherapi.dev/v1/sandbox/chat/completions \
-H "Authorization: Bearer sk-aetherapi-..." \
-H "Content-Type: application/json" \
-d '{
"model": "aether-sandbox",
"messages": [{"role": "user", "content": "Hello"}]
}'Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.aetherapi.dev/v1/sandbox",
api_key="sk-aetherapi-..."
)
response = client.chat.completions.create(
model="aether-sandbox",
messages=[{"role": "user", "content": "Hello"}],
extra_body={"sandbox": {"scenario": "success"}}
)
print(response.choices[0].message.content)
print(response.usage.total_tokens) # always 0JavaScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aetherapi.dev/v1/sandbox",
apiKey: "sk-aetherapi-...",
});
const response = await client.chat.completions.create({
model: "aether-sandbox",
messages: [{ role: "user", content: "Hello" }],
sandbox: { scenario: "success" },
});
console.log(response.choices[0].message.content);
console.log(response.usage.total_tokens); // always 0The base URL ends at /v1/sandbox so the SDK appends /chat/completions. Point the SDK at /v1/sandbox for the Responses or Messages protocol instead; the sandbox options object is identical.
Example response
{
"id": "chatcmpl-sandbox-3f6c1f7e-0f5c-4a0b-9d1e-6a2b7c8d9e0f",
"object": "chat.completion",
"created": 1777906388,
"model": "aether-sandbox",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "[Aether Sandbox] Simulated response. No provider was called."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}Responses on /v1/sandbox/responses and /v1/sandbox/messages carry the same simulated text in their own protocol shape, with zero usage as well.
Streaming
With stream: true the sandbox emits Server-Sent Events. The Chat Completions stream ends with data: [DONE]; the Responses and Messages routes translate the same events into their native stream formats.
cURL
curl -N https://api.aetherapi.dev/v1/sandbox/chat/completions \
-H "Authorization: Bearer sk-aetherapi-..." \
-H "Content-Type: application/json" \
-d '{
"model": "aether-sandbox",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.aetherapi.dev/v1/sandbox",
api_key="sk-aetherapi-..."
)
stream = client.chat.completions.create(
model="aether-sandbox",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
extra_body={"sandbox": {"delay_ms": 250}}
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")data: {"id":"chatcmpl-sandbox-...","object":"chat.completion.chunk","model":"aether-sandbox","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-sandbox-...","object":"chat.completion.chunk","model":"aether-sandbox","choices":[{"index":0,"delta":{"content":"[Aether Sandbox] "},"finish_reason":null}]}
data: {"id":"chatcmpl-sandbox-...","object":"chat.completion.chunk","model":"aether-sandbox","choices":[{"index":0,"delta":{"content":"Simulated response. "},"finish_reason":null}]}
data: {"id":"chatcmpl-sandbox-...","object":"chat.completion.chunk","model":"aether-sandbox","choices":[{"index":0,"delta":{"content":"No provider was called."},"finish_reason":null}]}
data: {"id":"chatcmpl-sandbox-...","object":"chat.completion.chunk","model":"aether-sandbox","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Usage chunk
Setstream_options: { include_usage: true } to receive one final chunk whose choices is empty and whose usage is zero.Tools and structured output
All three POST routes accept client function tools and JSON Schema output in their own protocol shapes, with or without streaming. The flow is deterministic and never calls a provider or executes a tool. The agent sandbox guide lists the full request shapes, the schema subset and its limits.
- With tools, the response contains exactly one function call; without a tool choice the first definition wins. parallel_tool_calls may only be false.
- Send the next request with the same tools, the complete conversation and one synthetic result directly after its call. The sandbox then answers with fixed text, or with the generated schema value when an output schema is set. It stores no conversation state.
- Schemas need an object root, exactly one type per node and additionalProperties: false on objects; only properties, required, items, minItems/maxItems, enum, title and description are allowed. json_object and other formats are rejected.
- Invalid definitions, arguments, results and schemas return sandbox_invalid_tool, sandbox_invalid_tool_arguments, sandbox_invalid_tool_result or sandbox_unsupported_schema (400) on Chat Completions and Responses; Messages keeps the Anthropic invalid_request_error envelope.
Simulated scenarios
Pass sandbox: { scenario: "..." } to force a failure without waiting for a real provider problem:
| Scenario | Result | Behavior |
|---|---|---|
| success | 200 | Simulated completion. The default scenario. |
| rate_limit | 429 | Simulated rate limit with a Retry-After: 1 header and code sandbox_simulated_429. |
| timeout | 504 | Simulated provider timeout with code sandbox_simulated_timeout. |
| provider_unavailable | 503 | Simulated provider outage with a Retry-After: 1 header and code sandbox_simulated_provider_unavailable. |
| stream_error | stream only | Only valid with stream: true. Emits partial output, then aborts with a sandbox_simulated_stream_error event and no [DONE]. |
stream_error requires stream: true; the request is rejected with 400 otherwise. The failure codes above appear in the same error envelope as production, so existing error handling can be exercised unchanged.
Delay
sandbox.delay_ms pauses before the response is sent. It accepts an integer from 0 to 5000 and defaults to 0; the timeout scenario defaults to 250. Streaming responses pause 40 ms between chunks as well, which makes loading and timeout states easy to reproduce. Values outside the range return 400.
Limits
- 60 requests per minute per account, 300 requests per minute per IP.
- 4 concurrent requests per account, 16 per IP, 128 globally.
- Request bodies are limited to 64 kb; larger bodies return 413.
- No images, audio, video, thinking, hosted tools, parallel tool calls, or stored Responses conversations.
Limit and routing failures use their own codes: sandbox_disabled (503) when the feature is off, sandbox_rate_limit (429) when a sandbox limit is hit, sandbox_capacity (429) when the global concurrency budget is exhausted, sandbox_invalid_request (400) for invalid options, and sandbox_endpoint_not_found (404) for an unsupported path. Sandbox routes never fall through to the production proxy.
Guarantees
- No provider is called: no provider cost is incurred for any sandbox request.
- No credits are consumed, and the sandbox path does not require a credit balance.
- Usage aggregates (calls, tokens, credits, model usage) are never changed and usage counters are always 0.
- Sandbox calls appear in the credit history as sandbox-marked entries with zero tokens and credits.
- Responses are marked with the x-aether-sandbox header and are never cached.
Production safety
A production endpoint can never silently simulate a request. Sending model: "aether-sandbox" or a sandbox object to a live route such as /v1/chat/completions always returns 400 with code sandbox_requires_explicit_path — even when the sandbox is disabled. Use the explicit /v1/sandbox path.
Boundaries
- Simulated tools: tool calls and schema values are generated from your definitions, so they test client bookkeeping and parsing, not a live model's tool or schema support.
- Deterministic: the response text is fixed and unrelated to the prompt, so the sandbox cannot be used to evaluate model quality.
- Server-side: AETHER_SANDBOX_ENABLED is read from the server environment and cannot be changed per request or per key.
- Not a provider proxy: unsupported sandbox paths return 404 instead of reaching a provider.