Integration sandbox and enable prerequisite
Rehearse text, tool-call, structured-output and error flows deterministically without calling a provider.
Also available as Markdown · all agent guides in one file
Key points
- The server operator must set
AETHER_SANDBOX_ENABLED=true; a client cannot enable it. Public production enablement is not asserted here. - Use a regular API key and the explicit
/v1/sandboxpath. It never calls a provider, consumes credits or changes usage aggregates. - A sandbox success verifies client transport, tool-cycle bookkeeping and parsing only, not a live model.
Enablement and authentication
Operator prerequisite
The server operator must explicitly setAETHER_SANDBOX_ENABLED=true for the running backend. This is a server configuration prerequisite; a client cannot enable it with a request header, body or model name. Public production enablement is not asserted here.- When disabled,
/v1/sandboxreturns 503sandbox_disabled. - Ask the operator for an enabled test environment; do not fall back to a live endpoint.
- Use a regular API key. Account, key, project membership and model-block checks still apply.
- Sandbox skips the credit-balance requirement and credit reservations; existing key and project-member spending limits and account suspension checks still apply.
- It never calls a provider, consumes credits or changes usage aggregates. Calls can appear as zero-cost sandbox-marked entries in credit history.
Endpoints
- Sandbox SDK base URL:
https://api.aetherapi.dev/v1/sandbox(replace the origin for an operator-provided test environment). GET /v1/sandbox/modelsadvertisesaether-sandbox.POST /v1/sandbox/chat/completions,/v1/sandbox/responsesand/v1/sandbox/messagesaccept text, client function tools andjson_schemaoutput in their own protocol shapes, each with optionalstream: true.- The sandbox path selects simulation. POST accepts any nonempty model name and echoes it, subject to authorization; use
aether-sandboxas the canonical fixture. - Passing a real model name here does not test that model.
- On live
/v1routes,model: aether-sandboxor asandboxbody property is rejected withsandbox_requires_explicit_path, even when the sandbox is disabled. Always select the explicit sandbox path.
Run one simulated request
The following requires curl, jq and AETHER_API_KEY. It uses AETHER_ORIGIN if an operator supplies a separate test server. It makes no changes to server configuration.
origin="$AETHER_ORIGIN"
if [ -z "$origin" ]; then origin="https://api.aetherapi.dev"; fi
jq -n '{model: "aether-sandbox", messages: [{role: "user", content: "Hello"}],
sandbox: {scenario: "success"}}' \
| curl --fail-with-body --silent --show-error \
"$origin/v1/sandbox/chat/completions" \
-H "Authorization: Bearer $AETHER_API_KEY" \
-H 'Content-Type: application/json' --data-binary @-A successful chat response contains [Aether Sandbox] Simulated response. No provider was called. and zero token usage. Response headers include x-aether-sandbox: true and x-aether-sandbox-scenario. Inspect those headers to confirm the intended mode.
Scenarios and limits
| Scenario | Result |
|---|---|
success (default) | Fixed text, normal JSON or SSE completion. |
rate_limit | HTTP 429, sandbox_simulated_429, Retry-After: 1. |
timeout | HTTP 504, sandbox_simulated_timeout; this is a simulated error, not a real hanging provider connection. |
provider_unavailable | HTTP 503, sandbox_simulated_provider_unavailable, Retry-After: 1. |
stream_error | Requires stream: true; emits partial text or tool-call arguments and sandbox_simulated_stream_error, then ends without a successful completion (no [DONE] on chat). Use it to test incomplete output handling. |
- Every scenario also applies to tool and schema requests.
sandbox.delay_msaccepts integers 0–5000. The timeout scenario defaults to 250 ms; other scenarios default to 0.- Token-limit fields, if supplied, must be integers 1–4096;
/messagesrequiresmax_tokens. - Not supported: images, audio, video, thinking, hosted/server or custom tools, parallel tool calls and stored Responses conversations (
previous_response_id,conversation,store). - Unknown fields return
sandbox_invalid_request. Request validation runs before the chosen scenario. - 64 kb JSON request limit; 60 requests/minute/account, 300/minute/IP; 4 concurrent/account, 16/IP, 128 globally.
- Real
sandbox_rate_limitorsandbox_capacityerrors are separate from simulated failures.
Rehearse a tool-call cycle
- With tools, the sandbox returns exactly one function call; without a tool choice the first definition wins.
tools: []produces text.parallel_tool_callsmay only be false.- The tool is never executed. Send the next request with the same tool definitions, the complete conversation and one synthetic result directly after its call.
| Protocol | Accepted tool_choice | Return the synthetic result as | Output schema |
|---|---|---|---|
| Chat | auto, none, required or {type: function, function: {name}} | a role: tool message with tool_call_id | response_format {type: json_schema, json_schema: {name, strict, schema}} |
| Responses | the same strings or {type: function, name} | the returned output items followed by {type: function_call_output, call_id, output} | text.format {type: json_schema, name, strict, schema} |
| Messages | {type: auto}, {type: none}, {type: any} or {type: tool, name} | a user tool_result block with tool_use_id | output_config.format {type: json_schema, schema} |
- Missing, duplicate or orphaned results are rejected. The sandbox stores no conversation state.
- After the last result the answer is
[Aether Sandbox] Simulated tool result accepted. No provider was called.withfinish_reasonstop(Messages:stop_reasonend_turn), or the generated schema value when an output schema is set. - Arguments are generated from the tool schema.
sandbox.tool_argumentsmay supply an object for a new call; it is validated against the same schema. - The same choice, arguments and history give the same
call_sandbox_…ID. Call IDs are not authentication.
This Chat Completions body declares one tool and an output schema. POST it to /v1/sandbox/chat/completions: the answer has finish_reason: tool_calls and one weather call with arguments {"city":"Berlin"}. Append that assistant message and {role: "tool", tool_call_id: <call id>, content: "synthetic result"} to messages, then send the body again: the assistant content is {"simulated":true} with finish_reason: stop.
{
"model": "aether-sandbox",
"messages": [{ "role": "user", "content": "What is the weather in Berlin?" }],
"tools": [{ "type": "function", "function": {
"name": "weather",
"parameters": { "type": "object", "properties": { "city": { "type": "string", "enum": ["Berlin"] } },
"required": ["city"], "additionalProperties": false }
} }],
"response_format": { "type": "json_schema", "json_schema": {
"name": "result", "strict": true,
"schema": { "type": "object", "properties": { "simulated": { "type": "boolean" } },
"required": ["simulated"], "additionalProperties": false }
} }
}Structured output and the supported schema subset
- Output schema names are 1–64 letters, digits,
_or-;strictis optional. - Other formats such as
json_objectare rejected. - The JSON value arrives as normal assistant text, immediately without tools or after the tool result.
Schemas for output and tool arguments:
- Object root; every node has exactly one type of
object,array,string,integer,number,booleanornull. - Objects require
additionalProperties: falseand allowpropertiesandrequired. - Arrays require
itemsand allowminItems/maxItemsfrom 0 to 16. - Primitives allow
enumwith 1–32 values;titleanddescriptionare allowed. - Every other keyword, including
$ref,anyOf,oneOf,allOf,const,default,format,patternandminimum, is rejected. - Generated values are deterministic: every property, the first enum value, otherwise
"sandbox", 0,trueornull; arrays getmax(minItems, min(1, maxItems))items.
| Limit | Maximum |
|---|---|
| Per schema | 8192 bytes, 128 nodes, 8 levels and 32 properties per object |
| Per generated value or submitted arguments | 16384 bytes |
| Per request | 16 tool definitions and 128 conversation items |
| Tool names | 64 characters (Messages: 128) |
- Chat and Responses add four 400 codes with
param,hintand request ID:sandbox_invalid_tool,sandbox_invalid_tool_arguments,sandbox_invalid_tool_resultandsandbox_unsupported_schema. - Messages keeps the Anthropic
invalid_request_errorenvelope. - With
stream: truethe call is split into protocol events: Chatdelta.tool_callsarguments,finish_reason: tool_callsand[DONE]; Responsesresponse.function_call_arguments.deltathroughresponse.completed; Messagesinput_json_deltathroughmessage_stop. - Parse arguments or JSON only after a successful completion.
What a sandbox success proves
A sandbox success verifies client transport, tool-cycle bookkeeping and parsing only. It does not prove a live model's availability, tool support, schema guarantees, context size, pricing or authorization for that model, and sandbox behaviour is not reflected in the production capability catalogue.