Create model response
Generate a model response, following a subset of the OpenAI Responses API wire format, if you prefer it over /v1/chat/completions. Both endpoints support tool calling.
Limitations:
store,background,conversation, andprevious_response_idare not supported. A request that sets one is rejected with a 400 naming the field. Send the full conversation ininputon every request, including any earlierfunction_callandfunction_call_outputitems, and keep each response if you need it later.stream: trueis not supported and is rejected with a 400. Send the request withoutstreamto receive the complete response.Only
functiontools are supported. Built-in tools (web_search,file_search,code_interpreter) are not available. The tooltypeis not checked: a tool without anameis rejected with a 400, and how a built-in tool with anameis answered is model-specific.Support for
tool_choicevalues is model-specific. A value the model does not support is rejected with a 422.
Fields that ResponsesRequest does not list are ignored, including fields the OpenAI Responses API defines, so check ResponsesRequest before relying on one.
Image input depends on the model: parts of type input_image are accepted for models advertising image input and rejected with a 400 for models that do not.
Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.
Request body for POST /v1/responses. A subset of the OpenAI Responses API. See the
endpoint description for its limitations.
ID of the model to use.
openai/gpt-oss-120bEither a single text string (shorthand for a single user message), or an ordered
list of input items: messages and, for multi-turn tool use, the function_call and
function_call_output items from earlier turns.
System-level instructions prepended to the conversation as a developer message.
Maximum number of tokens to generate, including reasoning and tool call tokens.
When the output reaches it, status is incomplete and incomplete_details.reason
is max_output_tokens.
Sampling temperature between 0 and 2.
Nucleus sampling probability mass, greater than 0 and at most 1. A value outside that range, including exactly 0, is rejected with a 400.
Penalizes tokens that have already appeared, encouraging new topics.
Penalizes tokens by how often they have appeared so far.
Number of most-likely tokens to return log probabilities for at each position.
Up to 4 sequences where generation stops. The stop text is not included in the
output. Same semantics as stop on /v1/chat/completions.
Controls which tool, if any, the model calls. none means no tool call, auto lets
the model decide, and required forces a tool call. A named tool object forces a
specific function.
Support for these values is model-specific. A value the model does not support is rejected with a 422.
Whether to allow the model to call multiple tools in parallel. When omitted, the model chooses. Whether it is honored is model-specific.
Opaque identifier for your end user.
If true, stream partial results as Server-Sent Events. Not supported: a request with
stream: true is rejected with a 400.
falseWhether to persist the response for later retrieval. Not supported: responses are
not stored, so a request setting store: true is rejected with a 400.
Whether to run the request asynchronously. Not supported, because it requires
store. A request setting background: true is rejected with a 400.
Conversation this response belongs to. Not supported: a request that sets it is
rejected with a 400. Send the full conversation in input instead.
Not supported. Responses are not stored, so a request containing this field is
rejected with a 400. Send the full conversation in input instead.
Successful operation. Returns a completed ResponsesResponse.
Bad Request
The request sent to the API was malformed.
Unauthorized
The request is missing authorization information or the authorization information provided are expired.
Forbidden
The user issuing the request does not have the needed permissions.
Not Found
The requested model or endpoint does not exist. A model that exists but lacks the capability the request needs is rejected with a 400 instead.
Payload Too Large
The request exceeds a size limit. The request body is limited to 16 MiB, an inline
base64 data URI to 12 MiB decoded, and an uploaded image or mask to 10 MiB. On
/v1/chat/completions, /v1/embeddings, and /v1/rerank, a message, query, or
document is limited to 2048 content parts. Count limits, such as the number of
documents, are stated with each field. Pass large media as a remote HTTP or HTTPS URL
instead of inline base64: a URL does not count against the size limits, though it
still counts as a content part.
Unprocessable Entity
The request was well-formed but contains semantic errors.
Too Many Requests
Your contract's rate limit is exhausted. Wait the number of seconds in Retry-After
before retrying, rather than a delay of your own. The OpenAI SDKs do this
automatically. Limits are contract-specific.
Internal Server Error
The request could not be completed because of an internal error. The request was
not necessarily rejected, so a retry is safe for idempotent calls. If it persists,
quote the value of the X-Request-Id response header when contacting support.
Bad Gateway
The model could not be reached, or stopped before it finished answering. No partial answer is returned in its place, and nothing is billed for it. Retrying is reasonable. An image or video URL in the request whose host cannot be reached, times out or answers with a server error is also answered this way.
Service Overloaded (503)
Too many large requests are already being handled at once. This applies only
to a request above a size threshold, or one sent with chunked transfer
encoding. An ordinary-sized request is never refused this way. Always retry
using the Retry-After header, not a fixed delay, to avoid a synchronized
retry storm. For sustained traffic in media, keep individual requests small:
pass large media in a JSON body as a remote HTTP or HTTPS URL rather than
inline base64, and keep a file upload small, for example by sending audio in
a compressed format such as MP3 or Opus. The message gives the advice that
fits how the request was sent.
Gateway Timeout
The model did not answer within the time allowed for it. The request may
have reached the model and may even have been served, so a retry is only safe for
idempotent calls. Retrying the same request unchanged tends to time out again: the
work itself is usually what was too slow, so prefer a smaller request (fewer or
smaller images, a shorter prompt, a lower n) or a model that can serve it.
Capacity Exhausted (529)
The service is temporarily overloaded. This is a non-standard status,
matching the convention used by other LLM providers for the same
condition: capacity is exhausted, not a client error (429) and not an
outage (503). error.code distinguishes a per-user throttle
(user_overloaded) from a system-wide capacity shortage
(server_overloaded). If you check only the status, treat both
alike. Always retry using the Retry-After header, not a
fixed delay, to avoid a synchronized retry storm.
POST /v1/responses HTTP/1.1
Host: openai.inference.de-txl.ionos.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 73
{
"model": "openai/gpt-oss-120b",
"input": "Name three cities on the Rhine."
}{
"id": "resp-abc123",
"object": "response",
"created_at": 1700000000,
"status": "completed",
"incomplete_details": null,
"model": "openai/gpt-oss-120b",
"output": [
{
"type": "function_call",
"id": "fc-1",
"status": "completed",
"call_id": "call-1",
"name": "get_weather",
"arguments": "{\"city\":\"Berlin\"}"
}
],
"usage": {
"input_tokens": 42,
"output_tokens": 12,
"total_tokens": 54
}
}Last updated
Was this helpful?