BlockRun
Integrations / OpenAI Codex

Point Codex at BlockRun and choose the model per task

clawrouter-codex translates Codex's Responses API onto BlockRun chat completions, so Codex runs on any model in the catalog — no OpenAI key, each call priced before it runs.

How it works

Codex speaks OpenAI's Responses API. clawrouter-codex is a small local front-adapter that accepts that shape, translates it onto chat completions, routes it through ClawRouter and pays for the call over x402. Codex sees an OpenAI-compatible endpoint; BlockRun sees a normal paid request.

The point is choice per task: a cheap model for boilerplate, a frontier model for the hard refactor, switched by the model string rather than by a second subscription. The open-weight models are free, so the adapter works before the wallet holds anything.

Behind it is the BlockRun catalog: 78 chat models plus image, video, music and speech generation, search, market data and multi-chain RPC, priced per call. 6 open-weight models are free and need no wallet.

Setup

1. Bring the adapter up

npx @blockrun/clawrouter-codex up

2. Run Codex with the profile it wrote

codex --profile clawrouter

Questions

Is this an OpenAI key replacement?
Yes for the model calls: the adapter pays per request from a local wallet, so Codex needs no OpenAI key to reach the models BlockRun serves.
Which models work?
Any chat model in the catalog — OpenAI's, Anthropic's, Google's, DeepSeek's and the open-weight ones — selected by name.

Two ways to run this

Get an API key

Sign in, get a key, and call the same endpoints with usage billed to your account. For teams that want one invoice instead of one wallet.

Get an API key 

Or let your agent pay per call, in USDC

No account, no API key. Three steps, and the last one is the request this page is about.

  1. 01
    Point your agent at BlockRun

    Install ClawRouter, or add the BlockRun MCP server to Claude Code, Cursor, Codex or OpenClaw. Any OpenAI-compatible client works too — change the base URL, nothing else.

    curl -fsSL https://blockrun.ai/ClawRouter-update | bash
  2. 02
    Fund a wallet with USDC

    Send USDC to a wallet on Base or Solana. There is no account to create and no API key to issue: the wallet is the account, and it pays per call.

  3. 03
    Use BlockRun from OpenAI Codex

    The first call returns HTTP 402 with the exact price, your agent signs it, and the answer comes back. Payment settles on-chain; nothing is charged if the call fails.

    npx @blockrun/clawrouter-codex up