Responses
Reference for POST /v1/responses: request fields, the response object, streaming events and the fields that are not supported.
Creates a model response in the OpenAI Responses format. Nothing is stored, so every request carries the full conversation.
POST https://usemodellane.com/v1/responses
Send the prompt in input and the model id in model. The request and response follow the OpenAI Responses format, so client.responses.create in the official SDKs and tools such as Codex work with only the base URL and key changed. Models, prices, limits and billing are the same as for Chat completions.
Hosted tools that run on OpenAI's servers (web search, file search, code interpreter, image generation) are removed from the request without an error. Fields not listed below are ignored. The Responses API guide covers conversations, tools and streaming with examples.
Request
modelstring requiredThe id of the model to use, the same id as in a chat completion request.
inputstring | array requiredThe prompt as a string, or the whole conversation as an array of items. Responses are never stored, so send the full history with every request. `custom_tool_call` and `custom_tool_call_output` items are accepted as well; earlier `reasoning` items are accepted and dropped.
Message
typestringThe item type. May be left out for messages.
rolestring requiredThe author of the message. `developer` is treated like `system`.
contentstring | array requiredA string, or an array of parts: `input_text` (`text`), `output_text` (`text`, for earlier assistant turns) and `input_image` (`image_url` as a base64 data URL, with an optional `detail`). Image links and `file_id` are rejected with `image_url_not_supported`; `input_file` and `input_audio` with `unsupported_content`.
Function call
typestring requiredA tool call the model made in an earlier turn, sent back unchanged.
call_idstring requiredThe id that links the call to its output.
namestring requiredThe function name.
argumentsstring requiredThe arguments as a JSON string.
Function call output
typestring requiredThe result of a tool call, produced by your code.
call_idstring requiredThe `call_id` of the call this output answers.
outputstring | array requiredThe result as a string, or an array of `input_text` and `input_image` parts. Images need a model with image input.
instructionsstringA system message placed before the input.
toolsarrayTools the model may call. Function tools work as in Chat Completions. Custom tools receive one free-text input; a grammar in the tool is passed to the model as a hint and is not enforced. Tools inside a `namespace` are flattened to plain names. Hosted tools such as web search, file search and code interpreter are ignored.
typestring requiredThe kind of tool.
namestring requiredThe tool name the model uses to call it.
descriptionstringWhat the tool does and when to use it.
parametersobjectThe arguments of a function tool as a JSON Schema object.
tool_choicestring | objectWhether the model may, must or must not call tools. To force one tool, send `{"type": "function", "name": "..."}`.
max_output_tokensintegerThe maximum number of tokens to generate, reasoning included. Works like `max_tokens` in Chat Completions.
temperaturenumberSampling temperature, as in Chat Completions.
top_pnumberNucleus sampling, as in Chat Completions.
textobjectOutput format. `text.format.type` is `text`, `json_object` or `json_schema`, as `response_format` in Chat Completions. `text.verbosity` is ignored.
streambooleanSend the response as server-sent events. The final `response.completed` event carries the usage.
metadataobjectUp to 16 string pairs, returned unchanged in the response. Not stored.
storebooleanAccepted, but responses are never stored; the response always reports `false`.
reasoningobjectAccepted and ignored. Reasoning effort cannot be set; models that reason do so on their own, and their reasoning comes back as a summary item.
parallel_tool_callsbooleanAccepted and ignored. Echoed in the response.
includearrayAccepted and ignored. Encrypted reasoning is never returned.
prompt_cache_keystringAccepted and ignored. Repeated prefixes are cached automatically.
previous_response_idstringNot supported, because responses are not stored. Requests with `previous_response_id`, `conversation`, `prompt` or `background: true` fail with `unsupported_parameter`.
Examples
curl
curl https://usemodellane.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODELLANE_API_KEY" \
-d '{
"model": "lane-1",
"instructions": "You are a helpful assistant.",
"input": "Hello!"
}'Python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["MODELLANE_API_KEY"],
base_url="https://usemodellane.com/v1",
)
response = client.responses.create(
model="lane-1",
instructions="You are a helpful assistant.",
input="Hello!",
)
print(response.output_text)Node.js
import OpenAI from "openai"
const client = new OpenAI({
apiKey: process.env.MODELLANE_API_KEY,
baseURL: "https://usemodellane.com/v1",
})
const response = await client.responses.create({
model: "lane-1",
instructions: "You are a helpful assistant.",
input: "Hello!",
})
console.log(response.output_text)Response
idstring requiredA unique id for the response, starting with `resp_`.
objectstring requiredThe object type.
created_atinteger requiredUnix timestamp (seconds) of when the response was created.
statusstring required`incomplete` when the output stopped early; `incomplete_details.reason` says why.
incomplete_detailsobject | null required`reason` is `max_output_tokens` or `content_filter` when the status is `incomplete`.
modelstring requiredThe model that produced the response.
outputarray requiredThe output items in order: reasoning, the message, then tool calls.
Message
typestring requiredThe item type.
idstring requiredThe item id.
rolestring requiredAlways `assistant`.
contentarray required`output_text` parts with the reply in `text`.
Reasoning
typestring requiredReturned when the model produced reasoning.
summaryarray required`summary_text` parts with the reasoning text.
encrypted_contentnull requiredAlways null.
Function call
typestring required`custom_tool_call` when the tool was declared as a custom tool.
call_idstring requiredSend it back in the matching `function_call_output` item.
namestring requiredThe tool the model wants to call.
argumentsstring requiredThe arguments as a JSON string (`input` for custom tools).
usageobject requiredToken counts for the request, the same numbers you are billed for.
input_tokensinteger requiredTokens in the prompt.
input_tokens_details.cached_tokensinteger requiredPrompt tokens served from cache.
output_tokensinteger requiredTokens generated, reasoning included.
output_tokens_details.reasoning_tokensinteger requiredGenerated tokens spent on reasoning.
total_tokensinteger requiredInput plus output tokens.
storeboolean requiredAlways false: nothing is stored.
metadataobject requiredThe metadata you sent.
Stream events
With stream: true every event is an event: line and a data: line holding a JSON object with type and an increasing sequence_number. The main events, in order:
response.createdeventFirst event. Carries the response object with status `in_progress`; `response.in_progress` follows.
response.output_item.addedeventA new output item starts: a message, a reasoning item or a function call (with empty arguments).
response.content_part.addedeventA text part starts inside a message item.
response.output_text.deltaeventA piece of the reply text in `delta`.
response.output_text.doneeventThe full text of the part; followed by `response.content_part.done`.
response.reasoning_summary_text.deltaeventA piece of the reasoning text. Framed by `response.reasoning_summary_part.added` and `.done`.
response.function_call_arguments.deltaeventA piece of a function call's arguments; `.done` carries the complete arguments.
response.output_item.doneeventThe finished item. Function calls are complete only in this event.
response.completedeventLast event. Carries the full response with `output` and `usage`. `response.incomplete` replaces it when the output stopped early.
response.failedeventThe request failed after the stream started. `response.error.code` names the error.
200
{
"id": "resp_123",
"object": "response",
"created_at": 1767225600,
"status": "completed",
"error": null,
"incomplete_details": null,
"model": "lane-1",
"output": [
{
"id": "msg_123",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{ "type": "output_text", "text": "Hello! How can I help you today?", "annotations": [], "logprobs": [] }
]
}
],
"usage": {
"input_tokens": 19,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens": 10,
"output_tokens_details": { "reasoning_tokens": 0 },
"total_tokens": 29
},
"store": false,
"metadata": {}
}200 (stream)
event: response.created
data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_123","object":"response","status":"in_progress"}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_123","output_index":0,"content_index":0,"delta":"Hello"}
event: response.completed
data: {"type":"response.completed","sequence_number":9,"response":{"id":"resp_123","object":"response","status":"completed","usage":{"input_tokens":19,"output_tokens":2,"total_tokens":21}}}400
{
"error": {
"message": "previous_response_id is not supported: responses are never stored.",
"type": "invalid_request_error",
"param": "previous_response_id",
"code": "unsupported_parameter"
}
}Errors#
Errors return {"error": {"message", "type", "param", "code"}}, with param naming the Responses field. The codes are the same as for Chat Completions, plus:
400 unsupported_parameter: the request uses stored state (previous_response_id,conversation,prompt,background) or anitem_referenceitem.400 image_url_not_supported: aninput_imageholds a web link or afile_idinstead of a base64 data URL.400 unsupported_content: aninput_fileorinput_audiopart, or an image sent to a model without image input.
When streaming, an error after the first event arrives as a response.failed event with response.error.code. Every code is listed on Error codes.