Skip to content

Create a Response

POST/v1/responses
API Access

Use the same AudioLab API URL as your other model requests. Confirm the model is enabled and your key has llm.write access. See the Text setup guide.

Overview

GPT-5.3 Codex uses a native, stateless Responses path that preserves reasoning items, encrypted replay, message phase, parallel function tools, and client custom tools in JSON and SSE.

Routing and provider details

Use openai/gpt-5.3-codex with store:false. Other admitted models use a limited translation: text, input_image and input_file (PDF) items, client function tools and the web_search tool. Persisted responses, previous_response_id, other hosted tools, background jobs, and compaction are not enabled, and the native Codex path takes no media. Routing (costream/auto, models, costream/fusion, router/<id>), dropped parameters and the routing explanation work as on Chat Completions; a stream carries routing on its response.completed event. Deployment and full coding-harness acceptance remain pending.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Parameters

x-audiolab-cacheheader · string

true stores a successful answer and serves an identical later request from your workspace with no provider call and no charge (usage.cost 0, usage.cache_hit true). The x-audiolab-cache-status response header reads HIT, MISS or BYPASS; zero data retention always bypasses. X-OpenRouter-Cache is accepted too.

x-audiolab-cache-ttlheader · integer

Seconds an answer stays cached, 1 to 86400. Default 300.

x-audiolab-cache-clearheader · string

true replaces the cached answer with a fresh one.

Request Body

application/json
modelstringRequired

Model ID from List Models, costream/auto, costream/fusion, or a named router as router/<id>. A model that several hosts serve routes across them; a host’s own ID selects that host. Add :nitro, :floor or :exacto to rank its hosts by throughput, price or tool-call validity, :free to keep free hosts, or :thinking to keep hosts that reason; an unknown suffix is refused. A ~author/family-latest alias, such as ~z-ai/glm-latest, selects the newest model of that family.

inputstring | arrayRequired

A text prompt or supported input items. Native Codex continuations replay the complete prior output array, then append matching function_call_output or custom_tool_call_output items. Preserve IDs, phase, and encrypted_content unchanged.

Show nested fields

A text prompt or supported input items. Native Codex continuations replay the complete prior output array, then append matching function_call_output or custom_tool_call_output items. Preserve IDs, phase, and encrypted_content unchanged.

max_output_tokensinteger

Maximum generated output tokens, up to the model’s output cap (top_provider.max_completion_tokens in List Models). Optional: without it the model may write up to that cap, within the context left, and you pay for the tokens it writes.

streamboolean

Return protocol-specific server-sent events.

Default: false

toolsobject[]

Client function tools, plus text/grammar custom tools on the native Codex path, and web_search to turn on the model’s own search. The application executes function tools; the gateway does not.

Show nested fields

object

modelsstring[]

Fallback models, tried in order when the one before fails before any output. Each must support the request’s tools, response format and reasoning settings.

Show nested fields

string

providerobject

OpenRouter provider preferences. only, ignore and order take provider names or slugs, or an endpoint tag such as deepinfra/turbo. sort (price, throughput, latency or exacto, with partition model or none), allow_fallbacks, quantizations, max_price, preferred_min_throughput, preferred_max_latency, zdr and data_collection are honoured; zdr and data_collection can only narrow your workspace’s privacy settings. data_region (us, eu or a country code, or a list of them) routes only to endpoints documented as processing there, fallbacks included; it can narrow the workspace’s Data Region but never widen it, and a request no endpoint can serve is refused with 400 data_region_unavailable. require_parameters: true refuses a request whose sampling parameters the model does not support, or a named router does not let requests override, instead of dropping them. enforce_distillable_text and options are accepted but not honoured, and are named in the x-audiolab-ignored-provider-fields header.

pluginsobject[]

auto-router (allowed_models, cost_quality_tradeoff) with costream/auto; fusion (analysis_models, preset, model); web (the model’s own web search); file-parser (pdf.engine: native, pdf-text or mistral-ocr; max_files); response-healing (repairs a non-streamed JSON answer); context-compression (middle-out).

Show nested fields

object

transformsstring[]

middle-out removes messages from the middle of a conversation until it fits the smallest context among the requested model and its fallbacks.

Show nested fields

string

router_revisioninteger

Named routers only: the published revision to use. Without it, the router’s current revision applies.

Minimum 1 · Maximum 1000

metadataobject

Named routers match their conditions on these values as metadata.<key>. metadata.session_id also keeps a session’s route, like session_id.

service_tierstring

flex (cheaper, slower) or priority (faster) on OpenAI and Gemini models with a reviewed price for that tier, charged at that tier’s rate; the response’s service_tier names the tier that served it. Elsewhere the tier is dropped and named in x-audiolab-dropped-params, or refused under provider.require_parameters. auto and default use the standard tier.

Values: "auto""default""flex""priority"

session_idstring

Keeps a session on one route: costream/auto reuses the model it chose (without session_id it recognises a conversation by its first messages), and a named router assigns the same A/B variant (without it, each request is assigned afresh).

storeboolean

Native Codex requests are stateless.

Values: false

Default: false

reasoningobject

Native Codex effort: low, medium, high, or xhigh; default low.

includestring[]

Request opaque reasoning for stateless replay.

Show nested fields

string

Responses

200Completed response or SSE stream when stream is true.
application/json

object

400Invalid or unsupported request contract. A named router’s refusal keeps its message and param.
401Invalid gateway credential.
402Insufficient credits.
404Unknown named router or revision.
409This idempotency key already identifies a request; provider inference is not repeated.
422A named router’s revision cannot run under current policy.
429Rate or concurrency limit.
502Every candidate failed with a provider error before any output, on a stream as well.
503Inference disabled or managed accounting not ready.