Skip to content

Create response

OpenAI Responses API: used by Codex CLI and by GPT, GLM, Qwen, Grok and other models; stateless, so send the full history every turn.

POST/v1/responses

OpenAI Responses-compatible endpoint; Codex CLI uses it. HopBase Responses is stateless: store is always false and previous_response_id is removed, so send the full input every turn in multi-turn conversations.

Fields not listed are forwarded as-is; for fields a model does not accept (such as DeepSeek's truncation and reasoning.summary), each model page says whether they are silently dropped. If a stream fails midway, it is reported as event: response.failed and the HTTP status stays 200.

Headers

Authorization:requiredstring

Bearer sk-…: an API key created in the console under API keys; its group must include the requested model

Body parametersJSON

model:requiredstring

A model ID in the current key's group. Groups that support Responses: GPT (Codex), GLM-5.3, Qwen, Grok, and deepseek-v4.1-flash; Gemini does not

input:requiredstring or array of object

A string is wrapped into a single user message automatically; a message array also works. Qwen content parts accept only input_text, input_image and input_file, not video

max_output_tokens:optionalinteger

Output cap. The gateway does not truncate or rewrite it; the limit follows the model's official spec

stream:optionalboolean

true returns a Responses SSE event stream; see Streaming events

Defaultfalse

tools:optionalarray of object

Tool definitions, forwarded as-is. Responses function tools are flat (name sits next to type), unlike Chat Completions

tool_choice:optionalstring or object

Forwarded as-is

reasoning:optionalobject

Reasoning config, forwarded as-is. Codex CLI's model_reasoning_effort is written here

service_tier:optionalstring

Only priority / flex are kept; other values are removed before forwarding

Valuespriorityflex

previous_response_id:optionalstring

Not supported: the gateway removes this field and does not continue the previous turn. For multi-turn conversations, include the full history in input

store:optionalfalse

Always false: responses are not stored server-side and cannot be retrieved by ID later

Defaultfalse

Returns

200Success. Non-streaming returns response JSON; with stream: true it returns SSE

id:optionalstring

Response ID (store is always false, so it cannot be retrieved by ID)

object:optional"response"
created_at:optionalinteger

Unix seconds

status:optionalstring

completed / incomplete / failed

model:optionalstring

Model ID

output:optionalarray of object

Output items: message, reasoning, function_call, etc.

usage:optionalobject

Token usage

error:optionalobject or null

Error on failure

Errors

400Unreadable request body or missing fields
401Missing, invalid or expired API key (missing_api_key / invalid_api_key / api_key_expired)
402Balance, or key / member / department quota, exhausted (insufficient_quota)
404The model is not in this key's group (model_not_found), or the path does not belong to the group (route_not_found)
413Request body over 60 MB (request_too_large)
429Account or key concurrency cap reached (user_concurrency_limit / apikey_concurrency_limit), with Retry-After
503If the message says the stateful session "can no longer be resumed", drop previous_response_id and start a new conversation

Related