Last updated

Codex Claude: Use Claude Opus 4.8 in Codex

This guide shows you how to add Claude models to the Codex model picker with Codex Router. The router ships a credential-isolated Anthropic API provider with Claude Opus 4.8, forwarding requests through the native Anthropic Messages protocol.

ClaudeClaudeAnthropic API

What you can add

Picker labelModel IDAuthentication
Claude Opus 4.8 (API)anthropic-api/claude-opus-4.8Separately billed Anthropic API key

The Claude Opus 4.8 route is the built-in Anthropic entry. If you access Claude through Command Code’s Provider API, its Messages catalog also includes Claude Sonnet 5, Claude Opus 4.8, Claude Fable 5 and Claude Haiku 4.5 as commandcode-messages/... entries — that is a separate provider family billed by Command Code.

Requirements

  • The Codex App or CLI, plus the usual prerequisites (see the installation guide).
  • An Anthropic API key. Anthropic API access is a separate account and billing system from ChatGPT, Kimi, DeepSeek and xAI — a ChatGPT or other key cannot authenticate Claude requests.

Enable the provider

./bin/model-router codex provider-key anthropic-api set
./bin/model-router codex providers enable anthropic-api

The set command opens a hidden prompt with terminal echo disabled. The key is stored in a per-user protected file (mode 600 on POSIX, a current-user ACL on Windows) and diagnostics report only presence and source. On Windows, use ./codex-router.ps1 codex provider-key anthropic-api set.

Never paste an Anthropic key into chat, a command argument, or a tracked file. The router sends it only to the configured Anthropic endpoint, and only for requests that select an Anthropic model.

Verify the integration

./bin/model-router codex doctor
./bin/model-router codex providers

anthropic-api must report SHOW and ready. Then fully quit Codex, reopen it, create a new task, and check the picker for Claude Opus 4.8. You can inspect the startup catalog with codex debug models. For a live, quota-consuming check:

./bin/test-model 'anthropic-api/claude-opus-4.8' --live --yes

How Claude requests behave

The router translates Codex’s Responses requests to the Anthropic Messages protocol through its shared credential-isolating forwarder, preserving streaming and tool-call shapes. Claude Opus 4.8 advertises the full reasoning-effort ladder — low, medium, high, xhigh and max — and the forwarder passes the effort you pick in the Codex picker through to Anthropic’s output_config.effort, rather than hardcoding a single value.

Common pitfalls

  • Missing picker entry usually means missing credentials. Confirm anthropic-api reports ready, then restart Codex. See models missing from the picker.
  • Anthropic keys do not work elsewhere. The router keeps each provider’s key in its own file, and an Anthropic key cannot authenticate any other provider (or vice versa).
  • Provider policy risk. Anthropic may restrict or block proxy traffic. Routing Claude through a third-party router is at your own risk; check Anthropic’s terms before relying on it.
  • Effort levels depend on your Codex build. On older Codex builds, unsupported effort values are republished at the nearest supported tier, so the picker may show fewer levels than Anthropic supports.

Related: models overview, DeepSeek in Codex, Grok in Codex, installation.