Responses
POST /api/v1/responsesOpenAI Responses format. Works with every model in the catalog via any-to-any translation.
Request body
Body — application/json (required)
modelstringrequiredModel slug to invoke (e.g. deepseek/deepseek-v4-pro).
inputstring | (message | function_call | function_call_output | reasoning)[]requiredConversation input: a shorthand string or an array of input items.
Show 2 variants
stringstring(message | function_call | function_call_output | reasoning)[](message | function_call | function_call_output | reasoning)[]Show 4 variants
messageobjectShow 3 nested fields
type"message"Item type discriminator (message).
rolestringrequiredConversation role. `developer` maps to `system`.
Possible values: system developer user assistant
contentstring | (input_text | output_text | input_image | input_file)[]requiredMessage content: a string or an array of input/output parts.
Show 2 variants
stringstring(input_text | output_text | input_image | input_file)[](input_text | output_text | input_image | input_file)[]Show 4 variants
input_textobjectShow 2 nested fields
type"input_text"requiredtextstringrequiredThe user text content.
output_textobjectShow 2 nested fields
type"output_text"requiredtextstringrequiredPrior assistant text content.
input_imageobjectShow 3 nested fields
type"input_image"requiredimage_urlstringrequiredImage URL or data: URL.
detailstringOpenAI vision detail level (low/high/auto).
input_fileobjectShow 4 nested fields
type"input_file"requiredfilenamestringOptional filename hint.
file_datastringFile contents as a data: URL.
file_urlstringFile contents as a fetchable URL.
function_callobjectShow 4 nested fields
type"function_call"requiredcall_idstringrequiredTool call id.
namestringrequiredFunction name.
argumentsstringrequiredJSON-encoded arguments string.
function_call_outputobjectShow 3 nested fields
type"function_call_output"requiredcall_idstringrequiredTool call id this output answers.
outputstringrequiredTool result output (string).
reasoningobjectShow 2 nested fields
type"reasoning"requiredsummaryobject[]Reasoning summary blocks.
Default: []
Show 2 nested fields
type"summary_text"requiredtextstringrequiredReasoning summary text.
instructionsstring | nullTop-level system instructions (alternative to a system message).
tools(function | object | object | object)[]Function tools, built-in server tools, OpenAI hosted tools, and/or OpenRouter server tools (024-R26).
Show 4 variants
functionobjectShow 5 nested fields
type"function"requirednamestringrequiredFunction name.
descriptionstring | nullNatural-language description for the model.
parametersobject | nullJSON Schema for the function arguments.
strictboolean | nullEnable OpenAI strict structured outputs.
objectobjectShow 3 nested fields
typestringrequiredBuilt-in server tool id (002-R11).
Possible values: web_search web_fetch pdf datetime image
eventsbooleanOpt this tool into `hi.tool_event` streaming (009-R55).
max_usesintegerMax invocations of this tool in the request (018). Default 1000.
objectobjectShow 6 nested fields
typestringrequiredOpenAI Responses hosted tool type (web_search_preview|file_search|code_interpreter|...).
search_context_sizestringPossible values: low medium high
user_locationobjectfiltersobjectvector_store_idsstring[]containeranyobjectobjectShow 4 nested fields
typestringrequiredOpenRouter server tool id (openrouter:web_search|...).
parametersobjectmax_usesintegereventsbooleantool_choicestring | functionHow to choose tools: auto, none, required, or a specific function.
Show 2 variants
stringstringPossible values: auto none required
functionobjectShow 2 nested fields
type"function"requirednamestringrequiredFunction name to force.
parallel_tool_callsboolean | nullAllow the model to call tools in parallel.
max_tool_callsinteger | nullMax total tool calls in the request.
max_output_tokensinteger | nullMax output tokens.
temperaturenumber | nullSampling temperature, 0–2.
top_pnumber | nullNucleus sampling probability, 0–1.
top_logprobsinteger | nullTop-N log probabilities per token.
includestring[]Derived fields to include (e.g. message.output_text.logprobs).
frequency_penaltynumber | nullPenalize tokens by frequency, -2 to 2.
presence_penaltynumber | nullPenalize tokens by presence, -2 to 2.
logit_biasmap<string, number> | nullToken-id → bias map.
seedinteger | nullSampling seed for best-effort determinism.
streambooleanStream SSE events instead of returning one object.
textobjectText output formatting (response format + verbosity).
Show 2 nested fields
formatobjectForce text, JSON, or a specific JSON Schema on the output.
Show 4 nested fields
typestringrequiredResponse format mode.
Possible values: text json_object json_schema
namestringSchema name.
schemaobjectJSON Schema describing the response.
strictbooleanEnable strict structured outputs.
verbositystringOutput verbosity dial.
Possible values: low medium high xhigh max
reasoningobject | nullReasoning controls (effort + summary).
Show 2 nested fields
effortstring | nullReasoning effort dial (none|minimal|low|medium|high|xhigh|max).
Possible values: none minimal low medium high xhigh max
summarystring | nullReasoning-summary verbosity (auto|concise|detailed) — accepted and ignored.
previous_response_idstring | nullNot supported — the gateway is stateless. Rejected explicitly.
storebooleanNot supported (stateless) — rejected when true.
backgroundbooleanNot supported (stateless) — rejected when true.
conversationstring | object | nullNot supported (stateless) — rejected when set.
promptobject | nullNot supported (stateless) — rejected when set.
service_tierstring | nullOpenAI service tier — accepted but the gateway owns tiering.
userstring | nullEnd-user identifier for abuse monitoring.
safety_identifierstring | nullAlternate end-user identifier (maps to `user`).
hi_tool_eventsbooleanOpt the whole request into `hi.tool_event` streaming (009-R55).
Generated at build time from the API's OpenAPI document — the same schemas that validate requests, so this section cannot drift from the API.
input accepts plain text or a list of input items. stream: true switches to the
semantic SSE event protocol — see Streaming. This endpoint is
stateless: previous_response_id is rejected — send the full input. Server tools
activate as built-in tool types in tools — see server tools.
Stop sequences are not expressible in this format and are rejected as
invalid_request — see the capability gaps.
Response
{
"id": "resp_def456",
"object": "response",
"created_at": 1767312000,
"status": "completed",
"model": "anthropic/claude-sonnet-4.5",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Speculative decoding drafts tokens…" }]
}
],
"usage": {
"input_tokens": 21,
"output_tokens": 34,
"total_tokens": 55,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens_details": { "reasoning_tokens": 0 }
}
}Reasoning models emit reasoning output items ahead of the message. The id is
resp_<request id> — pass the request ID (also returned in the X-Request-Id
header) to GET /generation.
Response schema
200Response
The response object. With `stream: true`, an SSE stream instead.
application/json
idstringrequiredresp_<request id>.
object"response"requiredcreated_atintegerrequiredUnix seconds.
statusstringrequiredPossible values: completed incomplete
incomplete_detailsobject | nullShow 1 nested field
reasonstringPossible values: max_output_tokens content_filter
modelstringrequiredoutputobject[]requiredOutput items in order: optional `reasoning` (summary_text), `message` (output_text content), and one `function_call` per tool call.
usageobjectrequiredShow 5 nested fields
input_tokensintegerinput_tokens_detailsobjectShow 2 nested fields
cached_tokensintegeraudio_tokensintegerAudio input tokens; omitted when 0.
output_tokensintegeroutput_tokens_detailsobjectShow 2 nested fields
reasoning_tokensintegeraudio_tokensintegerAudio output tokens; omitted when 0.
total_tokensintegertext/event-streamSSE streamSemantic SSE event protocol (`event:` + `data:` frames): `response.created` / `response.in_progress`, then per-item events (`response.output_item.added`, `response.output_text.delta`, `response.function_call_arguments.delta`, matching `*.done` events), ending with `response.completed` carrying the full response incl. usage (002-R8). Keep-alive comments every 15 s.
errorError envelope (any non-2xx status)
Error in this ingress format's native envelope, with the stable taxonomy `code` (002-R7). See the ErrorCode schema for the code → HTTP status mapping.
errorobjectrequiredShow 6 nested fields
messagestringrequiredtypestringrequiredOpenAI-compatible error class (e.g. invalid_request_error).
codestringrequiredStable error taxonomy (002-R7), identical across ingress formats. HTTP status per code: provider_auth=502, provider_rate_limit=429, provider_overloaded=529, context_length_exceeded=400, content_filter=400, provider_timeout=504, provider_unavailable=502, insufficient_credits=402, key_limit_exceeded=402, model_not_allowed=403, invalid_api_key=401, workspace_locked=403, rate_limit_exceeded=429, invalid_request=400, payload_too_large=413, internal_error=500.
Possible values: provider_auth provider_rate_limit provider_overloaded context_length_exceeded content_filter provider_timeout provider_unavailable insufficient_credits key_limit_exceeded model_not_allowed invalid_api_key workspace_locked rate_limit_exceeded invalid_request payload_too_large internal_error
paramstring | nullrequest_idstringretry_after_secondsintegerSeconds until the request can be retried (clamped to 1–120). Present iff a Retry-After HTTP header is also set — on rate_limit_exceeded (429), provider_rate_limit (429), provider_overloaded (529), provider_timeout (504), and provider_unavailable (502). Absent on all other errors.
Generated at build time from the API's OpenAPI document — the same schemas that validate requests, so this section cannot drift from the API.
Examples
curl
curl https://api.hyperinfer.ai/api/v1/responses \
-H "Authorization: Bearer $HYPERINFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.5",
"instructions": "You are a concise assistant.",
"input": "In one sentence: what is speculative decoding?",
"max_output_tokens": 256
}'Errors
OpenAI error object with the stable taxonomy.