Opus 5 vs Grok 4.6 Cost: 3.6x the Bill for 1.75x the Code
TL;DR: Opus 5 bills 3.6x what Grok 4.6 bills on the same task, while returning 1.75x as much code in half the wall clock. Underneath that, the two providers disagree about what counts as output, so one cost formula gives a correct answer on Opus 5 and an answer 78% too low on Grok.
How Much More Does Opus 5 Cost Than Grok 4.6?
Both prices read off the ofox model pages on 2026-08-20.
| Metric | Claude Opus 5 | Grok 4.6 |
|---|---|---|
| Input / 1M | $5.00 | $2.00 |
| Output / 1M | $25.00 | $6.00 |
| Cache read / 1M | $0.50 | $0.50 |
| Cache write / 1M | $6.25 (5 min), $10 (1 hr) | not charged |
| Context window | 1M | 500K |
| Max output | 128K | 66K |
| Released | 2026-07-25 | 2026-08-12 |
Two rows deserve more attention than the headline rates.
Cache writes are asymmetric. Anthropic bills you to put a prompt into the cache and again, at a lower rate, to read it back. xAI bills only the read. If your agent rewrites a long system prompt or a large tool schema on every session, that column decides more of your invoice than the $5-versus-$2 input rate does.
Grok 4.6 has a second price tier that the catalog does not expose. Once a prompt reaches 200K tokens, every token in that request bills at double ($4 in, $12 out), not just the tokens past the line. Nothing below crosses it; all the runs here sit at a few hundred prompt tokens.
What Does One Real Task Actually Bill?
$0.1417 on Opus 5, $0.0397 on Grok 4.6. That is 3.6x.
The task: rewrite a Python CSV-parsing module to stream instead of buffering, detect its header reliably, surface malformed rows instead of dropping them, and keep money as Decimal. Four runs per model, same prompt, same OpenAI-compatible endpoint, non-streaming, max_tokens 8000, on 2026-08-20.
| Opus 5 | Grok 4.6 | Ratio | |
|---|---|---|---|
| Prompt tokens | 270 | 381 | — |
| Visible output tokens (median) | 5,616 | 1,308 | — |
| Reasoning tokens (median) | not reported separately | 5,229 | — |
| Total tokens (median) | 5,886 | 6,865 | — |
| Wall clock (median) | 59.0s | 109.4s | Grok 1.85x slower |
| Output characters (median) | 9,044 | 5,160 | Opus 1.75x more |
| Bill per run (median) | $0.1417 | $0.0397 | 3.6x |
| Cost per 1,000 output chars | $0.01567 | $0.00769 | 2.0x |
The bill row is all-in: input at the listed rate plus everything the provider counts as output, priced as total_tokens - prompt_tokens. On Grok that deliberately includes the reasoning tokens.
So the headline holds and then stops holding. Opus 5 costs 3.6x as much per run. Normalise by what actually came back and it costs 2.0x as much. Still more expensive, but roughly double rather than roughly quadruple.
Both models produced a working module every time. All eight runs returned finish_reason: stop. The difference is thoroughness, not correctness: Opus 5 wrote more error branches, more docstring text, and in one run a small usage example.
Why Is Grok Slower If It Writes Less?
Because most of what it produces, you never see. Median reasoning was 5,229 tokens against 1,308 tokens of visible answer, four reasoning tokens for every token in the file it hands you. Opus 5 does think on this prompt too, but it does not report the split.
You can see Opus 5's hidden portion indirectly. In the first pass, without an explicit max_tokens, one Opus 5 run reported 4,096 completion tokens and returned 845 characters of text. Four thousand tokens do not produce 845 characters of Python. The rest was thinking that was billed and not returned.
Why Is Your Cost Estimate Wrong for Exactly One of These Models?
Because completion_tokens means different things on the two APIs.
Almost every cost snippet on the internet computes:
cost = (usage.prompt_tokens * in_rate + usage.completion_tokens * out_rate) / 1e6
Run that against the same four Grok 4.6 responses and it returns a median of $0.0086. The real median is $0.0397. The formula understates the bill by 78%.
The reason is one field:
| Field | Opus 5 | Grok 4.6 |
|---|---|---|
completion_tokens |
includes thinking | excludes reasoning |
completion_tokens_details.reasoning_tokens |
not present | present, and large |
total_tokens |
prompt + completion | prompt + completion + reasoning |
Verified on a short streamed request to both: Grok returned prompt 227 + completion 189 + reasoning 444 = total 860, and 227 + 189 alone is 416. Opus 5 returned prompt 40 + completion 891 = total 931, with no reasoning field at all.
The portable formula is total_tokens - prompt_tokens for the output side. It is correct on both, and it survives a provider adding a reasoning field later.
out_tokens = usage.total_tokens - usage.prompt_tokens
cost = (usage.prompt_tokens * in_rate + out_tokens * out_rate) / 1e6
Does the Same Prompt Cost the Same Tokens on Both?
No. Opus 5 charges fewer tokens for identical English text.
The 1,130-character prompt metered at 270 tokens on Opus 5 and 381 on Grok 4.6. Grok 4.6 carries a fixed per-request overhead of roughly 206 tokens that is not your text. Subtract it and your 1,130 characters cost about 175 tokens on Grok against 270 on Opus 5, or 6.5 versus 4.2 characters per token.
Two practical consequences:
- At a few hundred characters per call, 206 tokens of preamble is most of your input bill on Grok.
- Input is the small half here anyway. These runs produced 15-25x more output tokens than input tokens. Tokenizer differences move the total by single-digit percent.
What Do the Benchmarks Actually Say?
Neither model is on the Terminal-Bench 2.1 leaderboard.
A widely circulated summary this month put Opus 5 at 86.7% on Terminal-Bench 2.1. Pulling the official board on 2026-08-20:
| Rank | Agent | Model | Accuracy |
|---|---|---|---|
| 1 | Claude Code | Fable 5 | 83.8% ± 1.2% |
| 2 | Codex | GPT-5.5 | 83.1% ± 1.1% |
| 3 | Terminus 2 | Fable 5 | 80.4% ± 1.2% |
| 4 | Cursor CLI | Grok 4.5 | 79.3% ± 1.5% |
| 5 | Claude Code | Opus 4.8 | 78.9% ± 1.3% |
Seventeen entries in total, all verified by a Terminal-Bench team member, most recent dated 2026-07-11. No Opus 5. No Grok 4.6. The top score is 83.8%, so an 86.7% would sit above the top of a board it is not on.
That does not make 86.7% fabricated. Vendors run these suites internally and publish before submitting. It does mean the number is vendor-reported rather than a verified board entry.
The one thing the official board does say about the family is a detail nobody quotes: the Grok 4.5 entry at rank 4 carries a -9.0% hack rate, the largest on the board by a factor of ten, meaning the graders found that share of its passes came from gaming the test. Rank 5, Opus 4.8, is at -0.0%.
What Breaks When You Switch?
| Symptom | Cause | Fix |
|---|---|---|
| Output stops mid-file at exactly 4,096 tokens | No max_tokens set; that is the default |
Set it explicitly. Opus 5 allows 128K, Grok 4.6 allows 66K |
| Bill is ~4x your estimate on Grok |
completion_tokens excludes reasoning_tokens
|
Use total_tokens - prompt_tokens
|
| No reasoning text in the response on Opus 5 | Thinking is billed inside completion_tokens and not returned in non-streaming responses |
Stream if you need it |
| Prompt over 200K suddenly doubles on Grok | Second price tier applies to the whole request | Keep prompts under 200K or budget for $4/$12 |
The switch itself is a string change if you are already on an OpenAI-compatible endpoint:
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=OFOX_KEY)
def run(model: str, prompt: str) -> tuple[str, float]:
r = client.chat.completions.create(
model=model, max_tokens=8000,
messages=[{"role": "user", "content": prompt}],
)
u = r.usage
rates = {"anthropic/claude-opus-5": (5, 25), "x-ai/grok-4.6": (2, 6)}
ri, ro = rates[model]
out = u.total_tokens - u.prompt_tokens # correct on both APIs
return r.choices[0].message.content, (u.prompt_tokens * ri + out * ro) / 1e6
Which One Should You Actually Pick?
Split by task, and let output length be the deciding variable rather than the price.
Grok 4.6 for:
- Routine agent passes where a shorter, more focused answer is fine: test scaffolding, mechanical refactors, code explanation
- Anything with a long cached system prompt, where the absent cache-write charge compounds every session
- Batch and offline jobs where 109 seconds versus 59 seconds does not matter to anyone
Opus 5 for:
- Passes where completeness is the product: the run that has to enumerate all the error branches, not most of them
- Interactive work where a human is waiting. Half the wall-clock on this task
- Anything above 500K of context, which Grok 4.6 cannot hold at all
Neither, if: you are picking on a leaderboard number. Neither model is on the board that number came from.
Four runs on one task, summarised honestly: the expensive model is genuinely more thorough, the cheap model is genuinely cheap, and the ratio between those two facts is 2.0x, not 3.6x. Measure your own workload before you commit to either.
Frequently Asked Questions
Is Grok 4.6 cheaper than Claude Opus 5?
Yes, substantially. On list price Grok 4.6 is 26.7% of the combined rate. Measured on the same task, the median bill came out at 28.0% of Opus 5. But Opus 5 returned 1.75x as much code, so per thousand characters of output the gap narrows to 2.0x.
Why is my Grok 4.6 cost estimate too low?
Because completion_tokens does not include reasoning_tokens on Grok, while total_tokens does. The standard formula understates the bill by 78%.
Does Grok 4.6 or Opus 5 answer faster?
Opus 5, on this workload. Median wall-clock was 59.0 seconds for Opus 5 and 109.4 seconds for Grok 4.6 across four runs each.
Does Terminal-Bench 2.1 show Opus 5 ahead of Grok 4.6?
Neither model is on the leaderboard. Any 86-88% figure attributed to this benchmark for either model is vendor-reported, not a verified board entry.
Do both models charge for cache writes?
No. Anthropic charges separately to write a prompt into the cache ($6.25/M for the 5-minute TTL, $10/M for the 1-hour TTL) on top of $0.5/M cache reads. Grok 4.6 lists cache reads at $0.5/M and no write charge.
References
- ofox model page: Claude Opus 5
- ofox model page: Grok 4.6
- Terminal-Bench 2.1 leaderboard
- xAI developer docs: models and pricing
Originally published on ofox.ai/blog.
Top comments (0)