Skip to navigation

Create a response

OpenAI Responses-compatible endpoint. Models that list POST /v1/responses in supported_endpoints accept the Responses request shape: input, instructions, streaming, function tools, and structured output through text.format.

Responses are not stored: store is always false, whatever the request sets. Send the full conversation in input with every request. A previous_response_id, conversation, or prompt, or an item_reference input item, returns 400 with the code unsupported_parameter and param naming the field. Background responses are not available: background: true returns 400 with the code unsupported_value and param background. For a response past 15 minutes, use WebSocket mode.

A tool type the model does not support returns 400 with param naming the tool, for example tools[1].type. A web_search tool turns on the model’s own web search when the model has one.

The response object repeats the settings of the request, including tools, tool_choice, parallel_tool_calls, instructions, temperature, top_p, max_output_tokens, text, reasoning, user, and metadata. store is always false. A response cut off by max_output_tokens or a content filter has status incomplete, and incomplete_details.reason says which.

With stream: true the response is a Server-Sent Events stream of Responses events, starting with response.created and response.in_progress. A completed answer ends with response.completed, and an answer cut off by max_output_tokens or a content filter ends with response.incomplete. A stream that fails after it starts ends with response.failed, whose response.error gives the code and message; an error event can come just before it. The stream ends after its final event, with no [DONE] sentinel.

Authentication

AuthorizationBearer

Pass your EmpirioLabs API key as a bearer token. The Anthropic-style x-api-key header is also accepted on every endpoint.

Request

This endpoint expects an object.
modelstringRequired
inputstring or list of objectsRequired

The full conversation: a string, or a list of input items (messages, function calls, and function call outputs). Responses are not stored, so an item_reference item returns 400.

instructionsstringOptional
System instructions for the model.
streambooleanOptionalDefaults to false

Stream the response as Server-Sent Events.

storebooleanOptional

Responses are not stored, whatever this is set to; the response always reports false.

backgroundbooleanOptional

Background responses are not available. true returns 400 with param background and the code unsupported_value; leave it out or set it to false.

toolslist of objectsOptional

Tools the model may call, in the Responses format: function tools, and web_search, which turns on the model’s own web search when the model has one. A tool type the model does not support returns 400 naming it.

tool_choiceenum or map from strings to anyOptional

auto, none, required, an object naming one function, or an allowed_tools object that limits the call to some of tools.

temperaturedoubleOptional
Sampling temperature.
top_pdoubleOptional
Nucleus sampling probability.
reasoningobjectOptional

Reasoning settings such as effort, on models that offer reasoning control.

metadataobjectOptional

Your own key-value labels, repeated on the response.

userstringOptional
Your identifier for the end user, repeated on the response.
parallel_tool_callsbooleanOptionalDefaults to true
Allow the model to call several functions in one turn.
max_output_tokensintegerOptional

The most tokens the model may generate for the response, reasoning tokens included. A response that reaches it ends with status incomplete.

textobjectOptional

Output format, for example {"format": {"type": "json_schema", "name": "...", "strict": true, "schema": {...}}}.

enable_thinkingbooleanOptional
Enable model reasoning on models that advertise this parameter.
thinking_budgetintegerOptional>=1
Maximum tokens reserved for model reasoning on models that advertise this parameter.

Response

The response object, or a Server-Sent Events stream when stream is true.

idstringOptional
objectenumOptional
Allowed values:
created_atintegerOptional
Unix time in seconds when the response was created.
statusenumOptional
Allowed values:
modelstringOptional
outputlist of objectsOptional

Output items in order, such as message, function_call, and reasoning items. Item IDs start with msg_, fc_, or rs_.

output_textstringOptional

The text of every output_text part of the output, joined.

usageobject or nullOptional
incomplete_detailsobject or nullOptional

Set when status is incomplete.

errorobject or nullOptional

Set when status is failed.

instructionsstring or list of objects or nullOptional
max_output_tokensinteger or nullOptional
metadataobjectOptional
parallel_tool_callsbooleanOptional
previous_response_idstring or nullOptional
Always null. Responses are not stored.
reasoningobject or nullOptional
storebooleanOptional

Always false.

temperaturedouble or nullOptional
textobjectOptional
tool_choicestring or map from strings to anyOptional
toolslist of objectsOptional
top_pdouble or nullOptional
truncationstringOptional
userstring or nullOptional
backgroundbooleanOptional

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error