Quickstart: run Codex CLI on it

Codex speaks OpenAI’s Responses API and nothing else, so the gateway serves that format directly rather than asking you to run a shim.

The environment

export OPENAI_BASE_URL=https://api.magmarouter.com/v1
export OPENAI_API_KEY=rl-...

codex --model deepseek/deepseek-chat-v3.1

The base URL carries /v1 here, unlike the Anthropic one, because the Responses client appends only /responses.

What is translated

A Responses request becomes a chat-completions body on the way out and the answer becomes a Response object on the way back, over the same pipeline that bills every other route. Input items, instructions, function tools, tool results, structured output and streaming all map across. Streaming emits the real Responses event sequence, so the agent sees response.created, output items, text deltas and response.completed in order rather than raw chunks.

What is not

previous_response_id is refused with a clear error. Continuing a stored response means the gateway kept your conversation, and it keeps no prompts at all. Clients that set store: false, Codex included, send the full input each turn, so nothing is lost.

Hosted tools (web_search, file_search, computer_use) run inside OpenAI's own stack rather than in a model, so no upstream here can serve them. Function tools you define yourself work normally.

Pick a model that can call tools Codex is useless against a model with no tool support. Most of the uncensored catalogue cannot call tools, so use a tool-capable model as the driver and call an uncensored one for the step that needs it. See tool calling.