Loading
Skip to content
RedRouterRedRouter
Dashboard ↗

Responses & Codex

Use POST /v1/responses for stateless text generation and client-executed function or freeform tools. Send the complete input history on every turn, including each tool call and its matching result.

Codex CLI

Set REDROUTER_API_KEY to an API key from your account. Add this to ~/.codex/config.toml:

model_provider = "redrouter"
model = "glm-5.3-flash-rr"

[model_providers.redrouter]
name = "RedRouter"
base_url = "https://redrouter.org/v1"
env_key = "REDROUTER_API_KEY"
wire_api = "responses"

Run a task with an explicit catalog model:

codex exec -m glm-5.3-flash-rr "Explain the code in this directory"

glm-5.3-rr and deepseek-v4.1-flash-rr are also catalog IDs. Choose a model with tool calling enabled in Models. The same Responses provider configuration can be used by Codex Security clients that accept a custom provider.

Compatibility

instructions becomes a system message. input accepts a string or text messages with system, developer, user, or assistant roles, plus function_call, function_call_output, custom_tool_call, and custom_tool_call_output items. Codex namespaces are flattened into unique chat function names and restored in output. Freeform tools become functions with one string input argument; grammar hints are not enforced. Images, files, and hosted tools return 400 with the unsupported type. The exact cached web_search declaration sent by Codex is ignored. RedRouter does not execute it.

tool_choice, parallel_tool_calls, max_output_tokens, temperature, top_p, and text.format map to the selected model's existing capabilities. Output limits are capped to the model maximum. JSON schema and JSON object output require structured output support.

Accepted top-level fields:

model, instructions, input, tools, tool_choice, parallel_tool_calls, max_output_tokens, temperature, top_p, text, reasoning, stream, store, metadata, user, prompt_cache_key, include, service_tier, truncation, previous_response_id, conversation, client_metadata

store is accepted but always returns false. Responses are never persisted as retrievable resources. previous_response_id and conversation return 400; GET and DELETE response-resource routes are unavailable. This does not change request-log retention or Zero Data Retention.

reasoning.effort, reasoning.summary, text.verbosity, metadata, client_metadata, user, prompt_cache_key, include, service_tier, and truncation are accepted for compatibility and ignored. No server truncation is performed. Opaque encrypted reasoning items are ignored. Function strict is accepted as a hint; schema enforcement depends on the model. Unknown fields return 400.

Streaming and usage

Set stream: true for named SSE events with increasing sequence_number. Read through response.completed or response.incomplete. Midstream errors emit response.failed. Text, reasoning text, function arguments, and freeform input have delta and done events. Items and content parts have added and done events.

Usage includes actual input/output counts and cache/reasoning details when reported. Unknown usage is null, and its credit hold follows the existing reconciliation policy. Truncation returns status: "incomplete" with incomplete_details.reason: "max_output_tokens".

See the Responses schemas.

↑ ↓ to select · Enter to open · Esc to close