Create a response
The OpenAI Responses API, for the OpenAI SDK's responses.create, Codex and other clients that speak it. Requests pass through natively to models with a route certified for this endpoint (see Models), so input items, function tools, text.format structured output and reasoning work as in the OpenAI API. Nothing is stored unless you send store: true; then previous_response_id can continue the response (see Stored responses). Point the SDK's base URL here and use your project key.
Body
application/json, up to 1 MiB- modelstringrequired
A model slug, e.g.
openai/gpt-5-mini. A vendor's own name, such asgpt-5-mini, resolves to the catalog id, and a team alias such asorg/fastto the model it names, with its preset's defaults for fields you leave out. A model without a route certified for this endpoint is refused withinvalid_request; use chat completions for it. - inputstring | arrayrequired
A string, or input items: messages (
input_text,input_imageand other parts), earlierfunction_callandreasoningitems, and yourfunction_call_outputitems. Withprevious_response_id, only the new items.item_referenceis refused. - instructionsstringoptional
System instructions for this request.
- max_output_tokensintegeroptional
Upper bound on generated tokens, reasoning included. Also sets how much balance is reserved; Directives may lower it. Without it, output is limited to 4,096 tokens or your
maxOutputTokensDirective. - streambooleanoptional
Return Responses server-sent events (
response.created…response.completed). - toolsarrayoptional
functionandcustomtools, the client-runlocal_shellandapply_patch, and OpenAI's hostedweb_searchwithmax_tool_callson OpenAI models (see Web search). OpenAI's other hosted tools (web_search_preview,file_search,code_interpreter, computer use, image generation, remote MCP) are refused withunsupported_parameter, because their cost can't be reserved. - tool_choice, parallel_tool_callsoptional
As in the OpenAI API.
- textobjectoptional
text.formatwithjson_schemaorjson_objectfor structured output; the request goes only to routes that support it. - reasoningobjectoptional
effortandsummary, forwarded for models that support them. - storebooleanoptional
truekeeps the response for 30 days, so it can be continued, fetched and deleted (see Stored responses). Absent orfalse, nothing is kept, unlike the OpenAI API, wherestoredefaults totrue. Providers are always sentstore: false. - previous_response_idstringoptional
A stored response to continue: its conversation is put before your
input. The new response is stored too, unless you sendstore: false. - conversation, background, promptoptional
Refused: Inference Bureau keeps responses, not conversations, background responses or prompt templates.
- max_tool_callsintegeroptional
Forwarded. Required with
web_search, where it bounds the searches the request can run. - temperature, top_p, truncation, includeoptional
Forwarded, as in the OpenAI API. Reasoning items come back with
encrypted_content, so sending them on the next turn carries the reasoning forward. - user, safety_identifierstringoptional
Your end user (
userfirst), recorded for attribution and per-end-user Directives.useris not forwarded;safety_identifieris, as sent. - metadataoptional
Accepted and not forwarded.
- ibobjectoptional
Inference Bureau extension, removed before dispatch:
tags(up to ten) and the mixed-model fields, as on chat completions.
Headers
- Authorizationstringoptional
Bearer ib_live_…, as the OpenAI SDK sends it.x-api-keyworks too. - Idempotency-Keystringoptional
As for chat completions; keys are scoped to this endpoint and remembered for 24 hours. See Request IDs.
- X-Client-Request-IDstringoptional
Your own correlation id, recorded on the receipt.
- ib-userstringoptional
Your end user, up to 256 characters; wins over the body's. See End users and tags.
- ib-tagsstringoptional
Comma-separated tags for cost breakdowns, at most ten with
ib.tags. Never sent upstream. - ib-sessionstringoptional
Groups this turn with the rest of its conversation, like
ib.session. See Sessions.
The response id is the generation id, the same identifier chat completions return, and what previous_response_id and GET /v1/responses/{id} take when the response was stored. Look up the charge with GET /v1/requests/:id using the X-Request-ID header.
Stored responses
Send store: true to keep a response, then previous_response_id on the next turn instead of the whole conversation:
- What is kept. The request's input items, the output items and the response object, encrypted for your team, for 30 days. Continuing a chain keeps every response in it until 30 days after the latest.
instructionsare not carried over, as in the OpenAI API: send them on each turn. - Where. In Inference Bureau, never with the provider: every request is sent upstream with
store: falseand the conversation in full. A stored response is visible only to keys of the project and environment that made it. Inference Bureau's operators can't read it, and it is not shown in Logs. - Billing. The conversation
previous_response_idstands for is counted as input: the hold,maxInputTokensand the context window all apply to the whole of it, and the provider bills it as input, as on the OpenAI API. - Zero data retention. Where Directives require it,
store: trueandprevious_response_idare refused with403 policy_denied, and turning it on deletes the responses already stored under that level. - Streams. A streamed response is stored when it completes; its events show
store: false, as sent upstream. A turn that continues it right away waits up to 10 seconds for it to finish.
A response longer than 8 MB isn't stored: the response says store: false, and continuing it is refused.
Retrieve, delete and input items
| Endpoint | |
|---|---|
GET /v1/responses/{id} | The stored response, with store: true and the previous_response_id it continued. While it streams, a bare response with status: "in_progress". |
DELETE /v1/responses/{id} | { "id", "object": "response", "deleted": true }. Responses that continued it can no longer be continued. |
GET /v1/responses/{id}/input_items | Every item the response was generated from, the earlier turns' included, as { "object": "list", "data", "first_id", "last_id", "has_more" }. limit (1–100, default 20), order (desc by default) and after (an item id) page through it. |
A response another project or environment stored, one that expired or was deleted, or one never stored returns 404 not_found. The OpenAI SDK's responses.retrieve, responses.delete and responses.inputItems.list call these.
Compaction
POST /v1/responses/compact is OpenAI's conversation compaction, which Codex calls on its own to shrink a long session into one compaction item. Send model, input (or previous_response_id) and instructions; the answer is OpenAI's, unchanged.
- OpenAI models only, and only on OpenAI itself: the upstream gateway can't send a compaction to another provider, or with the flags that enforce your data rules, so it is refused with
403 policy_deniedwhen Directives require zero data retention or no training, or excludeopenai. - Reasoning items another provider of the model produced (Azure) are left out, because OpenAI can't read them.
- It is billed like a response, from the usage it returns at the model's list prices (cached input at the cache read price). Compaction has no output limit, so the hold covers 32,768 output tokens; a compaction that costs more is charged the hold. It appears in Logs as
responses.compact.
Errors
Errors use the same shape as chat completions, { "error": { "code", "message", "param", "request_id" } }, which the OpenAI SDK raises as an APIError; see Errors. A stream that breaks after it started ends with an event: error frame whose code is stream_interrupted, and no response.completed.
Limits
Same as chat completions: 1 MiB request bodies, 240 seconds overall, and a stream that sends nothing for 30 seconds is ended. A non-streamed response may take the whole deadline. Requests with web_search get 10 minutes, as on Web search. Mixed-model sessions work here with inline suggestions (send ib in the body, the SDK's extra_body) and pre-flight (/v1/suggest takes the Responses body); a switch can move the session only to pool models this endpoint serves.