POST /v1/responses is the main Codex interface for this connection. It supports text requests and history, instructions, client functions, non-streaming and streaming replies. Keys have no product modes; a server prompt is configured separately.
| Input | Support |
|---|---|
input | A string or message-item array with input_text; also function_call and function_call_output for continuing a client-tool loop |
| Generation | max_output_tokens, stream; application of temperature and top_p depends on the model and thinking |
| Client tools | type: "function" tools, tool_choice, and a compatible parallel tool loop; the client executes each function |
| Response | output_text and function_call; streaming ends with response.completed, while output-limit truncation returns status: "incomplete" |
curl https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer $GUARD_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"instructions": "Answer briefly",
"input": "Connection check: reply OK",
"max_output_tokens": 64
}'- PDF /
input_file,input_image, native citations, and server-side Web/MCP tools are outside the Responses contract. Use Messages for PDFs and images. top_k, explicitcache_control, native thinking/reasoning blocks, and structuredtext.formatare outside the supported contract.claude-fable-5andclaude-fable-5-1are available here, including streaming and client functions. This endpoint retains its data-type limitations.- Explicitly forbidden types or semantics receive a local
400before billing. Compatibility-only fields such asprevious_response_id,include,truncation, orprompt_cache_keymay be accepted without effect, so do not rely on them.
All three families work here: Kimi, Composer and Grok. The surface is the same one; what is shorter is their list of accepted fields.
Kimi is served here: the key and the address are the ordinary ones, model takes an exact Kimi id, and the text or the history goes into input. The ready Codex configuration for this surface is on the Codex page. If your client is happier with OpenAI Chat Completions, the same key works there too.
curl -X POST https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer gd-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "k3",
"input": "Hello!",
"max_output_tokens": 128
}'curl https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer gd-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "cursor-grok-4.6-low",
"instructions": "Answer briefly",
"input": "Connection check: reply OK",
"max_output_tokens": 64
}'curl https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer gd-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "composer-2.5",
"instructions": "Answer briefly",
"input": "Connection check: reply OK",
"max_output_tokens": 64
}'| What | How it works for Composer and Grok |
|---|---|
| Request fields | model, input, instructions, max_output_tokens, stream, tools |
input | a string or an array of type: "message" items with roles user, assistant, system, developer |
| Content blocks | input_text and output_text with type and text; cache_control is accepted and ignored. Grok also accepts input_image with inline base64. |
function_call, function_call_output | part of the client tool loop, served |
web_search_call, file_search_call, computer_call and other provider-hosted items | rejected with 400 cursor_client_tools_unavailable |
reasoning, temperature, top_p, store, include, truncation, metadata, previous_response_id, prompt_cache_key, thinking | accepted and silently dropped |
parallel_tool_calls: true, service_tier auto/default, tool_choice: "auto" | accepted at the default value only |
text, any other value of the fields above | not accepted, 400 cursor_parameter_unavailable |
| Response | status: "completed", text in output_text and in output[0].content[0].text, cache in usage.input_tokens_details.cached_tokens |
| Response with a tool call | a type: "function_call" item is added to output with call_id, name and arguments; you answer it with a function_call_output item in the next request |
All seven GPT models work through both aliases: POST https://api.guardrelay.ai/v1/responses and the retained POST https://api.guardrelay.ai/codex/v1/responses. They share one Responses lifecycle, one owner-scoped store, and the same billing.
curl https://api.guardrelay.ai/codex/v1/responses \
-H "Authorization: Bearer $GUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-astra",
"instructions": "Answer briefly",
"input": "Connection check: reply OK",
"reasoning": {"effort": "medium"},
"store": false
}'Responses supports JSON over HTTP, SSE with stream: true, and native WebSocket at wss://api.guardrelay.ai/v1/responses or wss://api.guardrelay.ai/codex/v1/responses. It supports instructions, reasoning effort, parallel client tools, images on compatible models, and actual usage; unknown fields are rejected before reserve or egress.
store: trueResponses, retrieve/delete, input items, and cancel use one owner-scoped lifecycle through both namespace aliases.- Conversations CRUD and their items use the same store and the same owner/key/payer rules through
/v1and/codex/v1. - Chat Completions and Messages pass the history supplied by the client. Guard does not invent server-side continuation across formats.
- All seven models have an official maximum output of 128,000 tokens. Guard accepts and preserves the Responses
max_output_tokensfield as advisory. Forced truncation at 128K is not promised; billing follows actual tokens and the key's money rules. - For all seven Codex models,
temperatureis unavailable through the current connection. Omit the field entirely: both an explicit value andtemperature: nullreturn400 invalid_requestbefore reserve or egress. GPT-6 Sol and GPT-6 Luna still supportreasoning.effort: nonewhentemperatureis absent. Supported efforts for the other models and thetop_pcontract are unchanged by this clarification. - Guard sends
service_tier: "fast"upstream aspriority; the response preserves the tier actually returned. The source may returndefault, so Fast availability and a speed-up are not guaranteed. - Batches, managed server agents, Projects/Tasks, server browser/MCP, and the broader hosted-resource API are outside this release.
Use POST /v1/responses or POST /glm/v1/responses. input can be a string or a non-empty array of native input items.
curl https://api.guardrelay.ai/glm/v1/responses \
-H "Authorization: Bearer $GUARD_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"glm-5.3","input":"Reply with OK","max_output_tokens":4096,"store":false}'{
"id": "resp_…",
"model": "glm-5.3",
"status": "completed",
"output": [
{"type": "reasoning", "content": []},
{"type": "message", "content": [{"type": "output_text", "text": "OK"}]}
],
"usage": {
"input_tokens": 31,
"input_tokens_details": {"cached_tokens": 0},
"output_tokens": 12,
"output_tokens_details": {"reasoning_tokens": 5}
}
}Guard adds store: true when the field is omitted. To keep a response unavailable for continuation, send explicit store: false.
{
"model": "glm-5.3",
"previous_response_id": "resp_from_first_response",
"input": "Continue from the previous answer",
"max_output_tokens": 4096
}| Result | Meaning |
|---|---|
404 response_not_found | The ID is unstored, unknown, or belongs to another key. |
409 response_account_unavailable | The bound session is temporarily unavailable; state is not moved automatically. |
When the budget is exhausted, Responses returns status: "incomplete" and incomplete_details.reason: "max_output_tokens"; in SSE, response.incomplete is the terminal event. Completed work has exact usage and is billable.
Use POST /v1/responses with an exact Gemini model. input can be a string or an array of input items; without an explicit max_output_tokens the gateway uses 4096 tokens.
curl https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer $GUARD_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"gemini-4-argon","input":"Reply with OK","max_output_tokens":4096}'Use POST /v1/responses with an exact Muse model. input can be a string or an array of input items.
curl https://api.guardrelay.ai/v1/responses \
-H "Authorization: Bearer $GUARD_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"muse-wonder-1.0","input":"Reply with OK","max_output_tokens":4096}'previous_response_id continues a Gemini response that Guard saved for the key owner: any of the owner's keys continues the dialogue, and the response is kept for 30 days; without the store field the response is stored, and after a response with store: false there is nothing to continue. An unknown or expired id gets 404 gemini_history_not_found: then send the whole history in input. Gemini does not accept the conversation field: a request with it gets the error gemini_history_required.
previous_response_id continues a Muse response created by the same key with store: true; without the store field the response is stored. After a response with store: false there is nothing to continue: send the history in input. An unknown id gets 404 response_not_found. Token counting needs the history in input, not in previous_response_id.