Skip to content
API referenceResponses (OpenAI)

Responses (OpenAI)

Responses requests, conversation state, and replies for the selected family.

Model protocol

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.

Supported contract

InputSupport
inputA string or message-item array with input_text; also function_call and function_call_output for continuing a client-tool loop
Generationmax_output_tokens, stream; application of temperature and top_p depends on the model and thinking
Client toolstype: "function" tools, tool_choice, and a compatible parallel tool loop; the client executes each function
Responseoutput_text and function_call; streaming ends with response.completed, while output-limit truncation returns status: "incomplete"
bash
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
  }'

Endpoint boundaries

  • 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, explicit cache_control, native thinking/reasoning blocks, and structured text.format are outside the supported contract.
  • claude-fable-5 and claude-fable-5-1 are available here, including streaming and client functions. This endpoint retains its data-type limitations.
  • Explicitly forbidden types or semantics receive a local 400 before billing. Compatibility-only fields such as previous_response_id, include, truncation, or prompt_cache_key may be accepted without effect, so do not rely on them.

Kimi, Composer and Grok on this endpoint

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 on this surface

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.

bash
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
  }'

Check Grok

bash
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
  }'

Check Composer

bash
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
  }'
WhatHow it works for Composer and Grok
Request fieldsmodel, input, instructions, max_output_tokens, stream, tools
inputa string or an array of type: "message" items with roles user, assistant, system, developer
Content blocksinput_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_outputpart of the client tool loop, served
web_search_call, file_search_call, computer_call and other provider-hosted itemsrejected with 400 cursor_client_tools_unavailable
reasoning, temperature, top_p, store, include, truncation, metadata, previous_response_id, prompt_cache_key, thinkingaccepted 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 abovenot accepted, 400 cursor_parameter_unavailable
Responsestatus: "completed", text in output_text and in output[0].content[0].text, cache in usage.input_tokens_details.cached_tokens
Response with a tool calla 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

Codex family Responses

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.

bash
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.

Confirmed Codex boundaries

  • store: true Responses, 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 /v1 and /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_tokens field as advisory. Forced truncation at 128K is not promised; billing follows actual tokens and the key's money rules.
  • For all seven Codex models, temperature is unavailable through the current connection. Omit the field entirely: both an explicit value and temperature: null return 400 invalid_request before reserve or egress. GPT-6 Sol and GPT-6 Luna still support reasoning.effort: none when temperature is absent. Supported efforts for the other models and the top_p contract are unchanged by this clarification.
  • Guard sends service_tier: "fast" upstream as priority; the response preserves the tier actually returned. The source may return default, 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.

GLM Responses

Use POST /v1/responses or POST /glm/v1/responses. input can be a string or a non-empty array of native input items.

bash
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}'
json
{
  "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}
  }
}

store and previous_response_id

Guard adds store: true when the field is omitted. To keep a response unavailable for continuation, send explicit store: false.

json
{
  "model": "glm-5.3",
  "previous_response_id": "resp_from_first_response",
  "input": "Continue from the previous answer",
  "max_output_tokens": 4096
}
ResultMeaning
404 response_not_foundThe ID is unstored, unknown, or belongs to another key.
409 response_account_unavailableThe bound session is temporarily unavailable; state is not moved automatically.

Incomplete is a valid terminal

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.

Gemini Responses

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.

bash
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}'

Muse Responses

Use POST /v1/responses with an exact Muse model. input can be a string or an array of input items.

bash
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}'

Gemini continuation in Responses

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.

Muse continuation in Responses

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.

Sections

On this page