Download

How to see which model handled each turn, and what it cost

AutoRouter8 min read

To see which model handled a turn and what it cost, use AutoRouter, the Mac app for all your coding agents: while it is the model selected, every turn shows its model, the cost and the reason. Natively, read each request's record in Claude Code and each turn's token report in Codex. In Claude Code, OpenTelemetry logs the model and estimated cost of every API request, and a prompt.id ties those requests to the prompt that caused them; for a scripted run, claude -p --output-format json reports the cost by model (Anthropic). In Codex, codex exec --json reports each turn's tokens, and you price them with OpenAI's published credit rates, because Codex reports no cost of its own (OpenAI).

AutoRouter wrote this post. Everything about Claude Code and Codex comes from Anthropic's and OpenAI's documentation, checked November 28, 2026, and linked where it is used.

Why can one session use more than one model?

Because the model you picked is not always the model that answered. In Claude Code, the opusplan setting uses Opus while planning and Sonnet while carrying out the plan, subagents can run on a model of their own, and a fallback model chain switches models for the current turn only when the primary is unavailable. Some requests that a Fable model, Opus 5.5, Sonnet 5.5 or Opus 5 flags for cybersecurity or biology re-run on an older model, such as Opus 5, Opus 4.8 or Sonnet 5, with a notice in the transcript, and the session carries on there (Anthropic). In Codex, a /model switch changes the model for the turns after it (OpenAI).

So a session total tells you what the session spent, and nothing about which turn spent it. How to use plan mode in Claude Code and multi-agent Claude Code cover the two most common reasons a Claude Code session mixes models.

How do you see which model Claude Code used?

Run /status or add a status line for the current model, and run /usage for a session's tokens by model. The status line script receives model.id and model.display_name on every update, and /status shows the model next to your account information (Anthropic). The Session block in /usage has a Usage by model line with input, output and cache tokens for each model the session touched (Anthropic).

Neither tells you which turn a model handled. A fallback chain is the hardest case: /status doesn't show the chain, and the notice when a switch happens is the only sign of it (Anthropic). How to check your Claude Code usage covers /usage and the status line in full.

How do you see what one Claude Code turn cost?

Export Claude Code's OpenTelemetry events and add up the claude_code.api_request events that share a prompt.id. Claude Code logs one api_request event for every request to Claude, with the model, an estimated cost_usd, the input, output and cache token counts, duration_ms, and a query_source that says whether the main thread, compaction or a named subagent made the request. One prompt can make several requests, and prompt.id links all of them, along with the tool results in between (Anthropic).

  1. Turn on telemetry and point the log exporter at an OpenTelemetry collector. Set these in your shell or in the env block of ~/.claude/settings.json; Claude Code ignores them in a repository's .claude/settings.json.
  2. Start claude and work as usual. Logs export every five seconds by default.
  3. In your observability tool, filter api_request events by one prompt.id, group them by model, and sum cost_usd and the token counts. That is the turn.
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
claude

For a single scripted turn, skip the collector. With --output-format json, claude -p returns total_cost_usd and a per-model breakdown in modelUsage (Anthropic):

claude -p "Write a one-line commit message for the staged diff" --output-format json \
  | jq '{cost: .total_cost_usd, models: .modelUsage}'

Every one of these dollar figures is an estimate. Claude Code computes it locally at list price unless your organization sets a modelPricing table, and on a Pro, Max or Ultra plan the turn draws on plan limits, which the /usage bars show (Anthropic). The estimate still answers the useful question: which turns are expensive, and on which model.

How do you see the model and tokens of each Codex turn?

Run /status for the active model and the session's token usage, and use codex exec --json when you need tokens turn by turn. /usage shows your account's token activity by day or week, with no model or turn breakdown. /statusline can keep the model, reasoning level and token counters in the footer, saved to tui.status_line in config.toml (OpenAI). With --json, codex exec streams events as JSON Lines, and each turn.completed event carries that turn's input_tokens, cached_input_tokens, output_tokens and reasoning_output_tokens (OpenAI):

codex exec --json -m gpt-6.2-sol "Summarize the repo structure" \
  | jq -c 'select(.type == "turn.completed") | .usage'

For interactive sessions, Codex's OpenTelemetry export is off by default and turns on with an [otel] block in config.toml. Every event and metric carries the model, and the turn.token_usage metric records each turn's tokens by type (OpenAI). None of these report a cost, so the price is up to you.

How do you work out what a Codex turn cost?

Multiply each kind of token by its credit rate. OpenAI publishes Codex rates in credits per million tokens, at Standard speed, as of November 2026 (OpenAI):

ModelInputCached inputOutput
GPT-6.2 Astra200101,000
GPT-6.2 Sol502.5250
GPT-6.1 Terra251.25125
GPT-6 Luna2.50.2512.5

Take the sample turn in OpenAI's codex exec documentation: 24,763 input tokens, 24,448 of them from cache, and 122 output tokens. On GPT-6.2 Sol, which OpenAI recommends for everyday coding, the 315 uncached input tokens cost 0.016 credits, the cached ones 0.061 and the output 0.031, about 0.11 credits in all. On GPT-6 Luna the same turn costs about 0.0084 credits, roughly a thirteenth.

The gap is smaller than Luna's twentyfold lower input and output rates suggest, because cached input is only ten times cheaper on Luna and this turn is almost all cache. Long sessions look like this: most of each turn's input is the conversation so far. On a ChatGPT plan, credits measure usage against included limits; OpenAI notes that credit prices alone don't set how much a plan includes. Codex usage limits explained covers what a plan holds.

Which tool shows the model and cost of each turn?

The event-level tools and AutoRouter do; the in-app commands report the session or the account. As of November 2026:

ToolModelCostPer turn
Claude Code /usageTokens by modelSession estimateNo
Claude Code status lineCurrent modelSession estimateNo
claude -p --output-format jsonBy modelEstimateYes, one run
Claude Code OpenTelemetryEach requestEstimate per requestYes, by prompt.id
Codex /status, /statusline and /usageCurrent modelNoneNo
codex exec --jsonFrom -m or configNone; price the tokensYes
Codex OpenTelemetryEach eventNone; price the tokensYes, tokens
AutoRouterEach turnEach turnYes

For teams, Anthropic's spend report in org analytics shows estimated spend per user and per model, updated daily, and OpenAI's usage insights in the Admin Console show messages and credits by use case and task. Both group spend over a period, and neither breaks it down by turn. How to cut Claude Code and Codex costs covers what to do once you know where the usage goes.

How does AutoRouter show the model and cost of each turn?

AutoRouter shows each turn's model, what it cost and why, while AutoRouter is the model selected in your coding agent's own model picker. It picks that model itself: your own rules decide a turn first, and otherwise it works out how hard the turn is and only considers models that clear the quality bar for it. How AutoRouter picks a model walks through the steps.

Because the reason sits next to the model and the cost, an expensive turn explains itself. You can see which models do best on which tasks and then write a rule or pick a model yourself, and if a pick falls short, you can rate it. The AutoRouter team reviews real routing decisions and every rating people send. AutoRouter keeps records of the model chosen, tokens and cost, plus the message that opens each turn, up to 4,000 characters, to review routing; it doesn't store transcripts (privacy). It works with every coding agent you use (Claude Code, Codex, Cursor, etc.), is in beta, runs on macOS 14 or later, and routing across the AI subscriptions you already pay for is free.

Questions

Does Claude Code's cost estimate match my bill?

Not exactly. Claude Code computes the figure locally at list price unless your organization sets a modelPricing table, so for billing Anthropic points API users to the Cost page in the Claude Console. On Pro, Max and Ultra, turns draw on plan limits, which the /usage bars show.

Does Codex show what a turn cost in dollars?

No. Codex reports tokens, and OpenAI publishes credit rates per million tokens for each model. What a credit costs depends on your plan or agreement.

Why doesn't the token count on Claude Code's spinner match /usage?

The spinner counts the output of the current turn only, and resets each turn. The Usage by model line in /usage adds up the whole session.

Can I find out which model handled a turn in an old session?

Only if you exported telemetry at the time. Claude Code keeps session transcripts under ~/.claude/projects/ and deletes them after cleanupPeriodDays, 30 days by default, and Anthropic documents per-request models and costs in the telemetry events, so export telemetry if you want that record.

Sources