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.
/v1/responsesOpenAI 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
Bearer sk-…: an API key created in the console under API keys; its group must include the requested model
Body parametersJSON
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
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
user / assistant / system / developer
A string or an array of content parts
Output cap. The gateway does not truncate or rewrite it; the limit follows the model's official spec
true returns a Responses SSE event stream; see Streaming events
Defaultfalse
Tool definitions, forwarded as-is. Responses function tools are flat (name sits next to type), unlike Chat Completions
function, or a server-side tool type the model supports
Function name
What the function does
JSON Schema for the parameters
Forwarded as-is
Reasoning config, forwarded as-is. Codex CLI's model_reasoning_effort is written here
GPT: low / medium / high / xhigh; higher effort thinks longer and uses more tokens. grok-4.20-multi-agent-0309 uses it to set the number of collaborating agents
Only priority / flex are kept; other values are removed before forwarding
Valuespriorityflex
Not supported: the gateway removes this field and does not continue the previous turn. For multi-turn conversations, include the full history in input
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
Response ID (store is always false, so it cannot be retrieved by ID)
Unix seconds
completed / incomplete / failed
Model ID
Output items: message, reasoning, function_call, etc.
message / reasoning / function_call
assistant for message
Content parts of a message
output_text
Output text
function_call: function name
function_call: arguments as a JSON string
function_call: referenced when returning the result
Token usage
Input tokens
Output tokens, including reasoning tokens
Total
Of which reasoning tokens
Error on failure
Errors
missing_api_key / invalid_api_key / api_key_expired)insufficient_quota)model_not_found), or the path does not belong to the group (route_not_found)request_too_large)user_concurrency_limit / apikey_concurrency_limit), with Retry-Afterprevious_response_id and start a new conversation