Run Codex on any model
Codex speaks one protocol and BlockRun speaks another. This is the translation layer between them — a thin front-adapter, never a fork of the router.
npx @blockrun/clawrouter-codex up
codex --profile clawrouterThe impedance mismatch
Codex talks to exactly one shape of endpoint: OpenAI's Responses API at /v1/responses. BlockRun, like most of the ecosystem, speaks chat completions. Neither is going to change for the other.
So the bridge sits in front, accepts what Codex emits, and speaks what the gateway understands.
Codex ──/v1/responses──▶ clawrouter-codex ──@blockrun/llm──▶ BlockRun
(x402 USDC)Two modes, and which one holds your key
Worth being precise about, because it decides where your private key lives.
| Mode | How it pays | Holds the key |
|---|---|---|
| directdefault | Pays BlockRun itself through the SDK. One process, no proxy. | The bridge. It reads ~/.blockrun/.session or BLOCKRUN_WALLET_KEY and signs x402 itself. |
| proxyopt-in | Forwards to a local ClawRouter proxy, which pays. Set BRIDGE_MODE=proxy. | The proxy. The bridge holds no key and signs nothing. |
Smart routing survives in either mode. Pick blockrun/autoand the request is classified and sent to the cheapest capable model by ClawRouter's rules engine, reused as a library — under a millisecond, and no extra model call to decide.
What the translation actually does
The mapping was read off Codex's own SSE contract rather than guessed from its docs.
| Codex sends | Becomes |
|---|---|
| instructions | A leading system message |
| function_call | An assistant message carrying tool_calls |
| function_call_output | A message with role: "tool" |
| Flat tool definitions | Nested under function |
| Chat completion chunks | The Responses SSE event sequence, back out |
What else is in there
A loopback dashboard
Wallet balance and funding QR, seven-day spend, the model picker, the web-search switch. Bound to localhost only — it reads wallet state and edits Codex config.
Web search that works
Codex's web_searchis a hosted tool only OpenAI's own backend runs. The bridge runs it via BlockRun Exa and feeds the results back in.
The Desktop quirk
Codex Desktop only renders custom models when a provider declares requires_openai_auth. The bridge sets it, ignores the forwarded ChatGPT token, and never sends it to OpenAI.
The picker ships a curated catalog rather than the whole gateway, so the list stays navigable; blockrun/auto reaches the rest by routing.
Limitations
Three of them, and they are in the release notes rather than the footnotes because they will affect how it feels to use.
Streaming is synthesized, not incremental
The bridge assembles the upstream response and then emits the Responses event sequence. Tokens do not arrive as the model produces them.
Reasoning items are dropped
Chat completions carry reasoning differently from the Responses API. Rather than guess at a mapping, the bridge omits those items.
Stateless only
No server-side conversation state. Each request carries its own history, which is how Codex drives it anyway.