Most articles comparing Codex and Claude Code ask “which one is better right now?” This article compares only billing and connectivity. Those are what matter when someone who is already paying for one decides whether to switch. It does not rank performance—as explained below, you can make that assessment in 30 minutes using your own repository.
First, what they have in common
Both run in the terminal, read and edit repository files, run tests, and even commit changes. Both have a dual billing structure—subscription usage limits and pay-as-you-go API key billing—and those are not combined. Their feature sets have converged enough that a feature list no longer settles which is better.
Difference 1 — How to change the endpoint
# 클로드 코드 — Anthropic 형식 환경 변수
export ANTHROPIC_BASE_URL=https://api.kunavo.com
export ANTHROPIC_AUTH_TOKEN=sk-kn-...
# 클로드 코드의 기본 모델과 opus 별칭은 최신 Opus를, sonnet 별칭은 Kunavo가
# 제공하지 않는 Sonnet 5.5를 가리키므로, /model sonnet이나 sonnet 서브에이전트가
# 404를 받지 않도록 모델을 고정합니다. opus 별칭이 가리킬 Opus 5.5는
# 클로드 코드 v2.1.280 이상이 필요합니다(이전 버전이면 claude update).
export ANTHROPIC_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
claude
# Codex CLI — OpenAI 형식. 단, 받아들이는 건 Responses API뿐입니다.
export OPENAI_BASE_URL=https://api.kunavo.com/v1
export OPENAI_API_KEY=sk-kn-...
codexClaude Code changes its destination with two lines of configuration: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Codex CLI looks similar, but there is one restriction: for custom providers, it accepts only POST /v1/responses(Responses API), and will not work with a provider that implements only chat completions.
Check this before the price list when choosing an alternative or deciding whether to use both. Setup instructions are in Codex CLI API key setup and Claude Code API key setup.
Difference 2 — Token prices
| Model | Input / output (per 1M) |
|---|---|
| Claude Sonnet 5(Claude Code default) | $1.40 / $7.00 |
| GPT-5.6 Sol(Codex default) | $2.00 / $12.00 |
However, unit prices tell only half the story of the bill. The actual amount depends on the context sent with each step, which varies with the tool's design and the size of your repository. Run the same task once with each and compare the response's usage. The actual pay-as-you-go costs and break-even points for each are calculated separately in Codex pricing and Claude Code pricing.
Difference 3 — What to do when you hit a limit (the most practical point)
The top search result compares the tools by “how many hours you get,” but there is a more important fact: their limits are counted separately. So when one is unavailable, you can switch to the other and continue working. This turns the question from “which one should I choose?” into “how can I alternate between them?”
You can also use one API key for both—they speak different protocols, Anthropic format and Responses format, to the same endpoint. The structure of Claude's usage window and your options when you hit a limit are described in Claude Pro limits.
Rank performance using your own repository
Public benchmarks vary depending on task selection, and the numbers have a short shelf life compared with the model update cycle. Any ranking written here may already be out of date by the time you read it.
Use a reliable procedure instead. Choose three tasks that have actually blocked you, give both tools the same instructions, and record only ① whether each was solved, ② the number of times you reverted, and ③ the tokens used. In 30 minutes, you will have a ranking for your own use case. The English comparison is in Claude Code vs Codex.
Frequently asked questions
What is the biggest difference between Codex and Claude Code?
The range of tasks they can handle has become similar across generations; in practice, billing and connectivity are what set them apart. Claude Code can change its destination through ANTHROPIC_BASE_URL, while Codex CLI accepts only the Responses API as a custom provider. Both have a dual structure of subscription limits and pay-as-you-go billing, but the limits are counted separately for each.
Can I use both together?
Yes, and many people do. Because the usage limits for the two tools are counted separately, you can switch to the other one when one limit is reached and continue working. You can also use one API key for both—they speak different protocols, Anthropic format and Responses format, to the same endpoint.
Which one is cheaper?
It depends on your usage pattern. By token price, on Kunavo, Claude Sonnet 5 costs $1.40 / $7.00 per 1M tokens, while GPT-5.6 Sol costs $2.00 / $12.00. However, the amount of context sent with each step determines the actual bill more than the unit price does, so the only reliable approach is to run the same task once with each and compare usage.
Can Codex use a different endpoint?
Any provider offering the Responses API (POST /v1/responses) will work. This is the catch: Codex CLI will not work with a gateway that implements only chat completions. Claude Code has no such restriction and works with an Anthropic-compatible /v1/messages endpoint. Check this before looking at the price list when choosing an alternative.
Which one performs better?
This article does not rank them. Public benchmarks vary depending on task selection, and the numbers have a short shelf life compared with the model update cycle. A more reliable approach is to choose three tasks that have actually blocked you in your repository, give both tools the same instructions, and record just three things: whether each task was solved, how many times you reverted, and tokens used. In 30 minutes, you will have a ranking for your own use case.
How much configuration needs to be redone when switching?
The environment variables take two lines on either tool, so setup takes a few minutes. The real migration work is in the project rules file, not the CLI configuration: instructions in Claude Code's CLAUDE.md need to be rewritten in the format used by the tool you are switching to. Check this file before migrating.