DEV Community

Cover image for How Much Does Grok 4.5 API Cost?
Hassann
Hassann

Posted on • Originally published at apidog.com

How Much Does Grok 4.5 API Cost?

Grok 4.5 is priced at $2 per million input tokens and $6 per million output tokens, according to xAI’s July 8 announcement. On paper, that makes it cheaper than every model in its claimed capability class.

Try Apidog today

The more useful number is not sticker price. It is output tokens per solved task. xAI claims Grok 4.5 uses 4.2x fewer output tokens than Claude Opus 4.8 on SWE Bench Pro. That changes how you should estimate real API costs.

This guide breaks down the pricing, the unconfirmed cache discount, the trade-off against Grok 4.3, and practical ways to estimate your own bill.

The full price sheet

From the xAI docs pricing page, as of July 9, 2026:

Item Price
Input $2.00 per 1M tokens
Output $6.00 per 1M tokens
Context window 500k tokens
Web / X search tool calls $5.00 per 1,000 calls
Priority processing 2x standard rates
Batch discount None listed for grok-4.5

xAI lists 20% batch discounts for grok-4.3 and the grok-4.20 family, but not for grok-4.5. If you run overnight batch jobs, do not assume Grok 4.5 is the cheapest option in xAI’s catalog.

xAI pricing table

Tool-call pricing also matters. If your agent uses web or X search heavily, add $5 per 1,000 tool calls on top of token costs.

The cached-input question

Some launch-day posts cited a $0.50 per million cached-input rate, and OpenRouter’s listing surfaced similar figures.

As of July 9, 2026, xAI’s release page and docs pricing page do not confirm cached-input pricing for grok-4.5.

Action item: do not model production costs around cached input until xAI documents it in the console or pricing docs. If it becomes available, re-run your estimates, because prompt caching can cut agent costs significantly.

Grok 4.5 vs Grok 4.3 pricing

Grok 4.5 is newer, but it is not automatically the cheaper model for every workload.

grok-4.5 grok-4.3
Input / output per 1M $2.00 / $6.00 $1.25 / $2.50
Context 500k 1M
Batch No discount listed 20% off

Use grok-4.3 first for:

  • Long-context retrieval
  • Document analysis
  • Bulk batch processing
  • RAG workloads where input tokens dominate

Use grok-4.5 when the workload benefits from higher capability per token, especially:

  • Coding agents
  • Multi-step agentic workflows
  • Tasks where shorter successful outputs reduce loop cost

For a model-selection breakdown, see the Grok 4.5 API guide.

Effective cost: why token efficiency matters

xAI reports the following SWE Bench Pro output-token averages:

  • Grok 4.5: 15,954 output tokens per resolved task
  • Claude Opus 4.8 max: 67,020 output tokens per resolved task

That gives this output-cost comparison:

Model Output tokens/task Output price Output cost/task
Grok 4.5 15,954 $6/M ~$0.10
Opus 4.8 max 67,020 $25/M ~$1.68

The per-token output price gap is large, but the per-task gap is larger because Grok 4.5 is both cheaper per token and reported to use fewer output tokens.

That said, treat this carefully:

  • The token counts are vendor-reported.
  • They come from one benchmark.
  • Opus 4.8 max mode is intentionally verbose because extended reasoning helps on harder evaluations.
  • Opus 4.8 scores higher on SWE Bench Pro: 69.2% vs 64.7%.

The practical takeaway is simple: benchmark your own prompts. If Grok 4.5 solves your tasks with shorter outputs, the cost advantage can compound quickly.

For the capability comparison, see Grok 4.5 vs Claude Opus 4.8.

Estimate real workload costs

Use this formula:

monthly_cost =
  (input_tokens / 1_000_000 * input_price)
+ (output_tokens / 1_000_000 * output_price)
+ (tool_calls / 1_000 * tool_call_price)
Enter fullscreen mode Exit fullscreen mode

For Grok 4.5:

monthly_cost =
  (input_tokens / 1_000_000 * 2)
+ (output_tokens / 1_000_000 * 6)
+ (search_tool_calls / 1_000 * 5)
Enter fullscreen mode Exit fullscreen mode

Example 1: support chatbot

Assumptions:

  • 500 input tokens per exchange
  • 300 output tokens per exchange
  • 100,000 exchanges/month

Token volume:

Input:  500 * 100,000 = 50,000,000
Output: 300 * 100,000 = 30,000,000
Enter fullscreen mode Exit fullscreen mode

Cost:

Input:  50M * $2/M = $100
Output: 30M * $6/M = $180
Total:  $280/month
Enter fullscreen mode Exit fullscreen mode

Example 2: agentic coding pipeline

Assumptions:

  • 200 tasks/day
  • 30 days/month
  • ~30k input tokens/task
  • ~16k output tokens/task

Token volume:

Tasks/month: 200 * 30 = 6,000
Input:       6,000 * 30,000 = 180,000,000
Output:      6,000 * 16,000 = 96,000,000
Enter fullscreen mode Exit fullscreen mode

Cost:

Input:  180M * $2/M = $360
Output: 96M * $6/M = $576
Total:  ~$936/month
Enter fullscreen mode Exit fullscreen mode

The same volume using Opus 4.8-style output verbosity and rates can move into five figures.

Example 3: document-heavy RAG

If each request injects 100k-token contexts, input dominates.

At that point, compare Grok 4.5 against:

For RAG, the cheapest capable model is often the one with the best input-token economics, not the strongest benchmark score.

Grok 4.5 pricing vs the market

Model Input / output per 1M
Grok 4.5 $2 / $6
Claude Opus 4.8 $5 / $25
Claude Fable 5 $10 / $50
Grok 4.3 $1.25 / $2.50

Against Claude Opus 4.8 pricing, Grok 4.5 costs:

  • 40% as much on input
  • 24% as much on output

Against Claude Fable 5, it is an 80%+ discount, but with a real capability gap.

The practical framing: Grok 4.5 is positioned as near-Opus capability at a much lower price, not as the absolute frontier model.

Also remember that launch prices can change. If you are making lock-in decisions, leave margin for future price increases.

How to keep your Grok 4.5 bill under control

1. Measure token usage before migrating

Run your real prompts against grok-4.5 and your current model. Compare the usage object in each response.

Example response fields to log:

{
  "usage": {
    "prompt_tokens": 30000,
    "completion_tokens": 16000,
    "total_tokens": 46000
  }
}
Enter fullscreen mode Exit fullscreen mode

Track:

  • Input tokens
  • Output tokens
  • Tool calls
  • Success rate
  • Retries
  • Latency

If Grok 4.5 does not produce shorter successful outputs on your workload, the published efficiency advantage may not apply.

You can use Apidog to run repeatable API tests and compare responses across models.

2. Log tool calls separately

Search tool calls are billed separately from tokens:

$5 per 1,000 web / X search calls
Enter fullscreen mode Exit fullscreen mode

For agentic workflows, log these as a separate metric:

{
  "model": "grok-4.5",
  "input_tokens": 30000,
  "output_tokens": 16000,
  "web_search_calls": 4,
  "x_search_calls": 2
}
Enter fullscreen mode Exit fullscreen mode

Token dashboards alone will miss this cost.

3. Mock the API during development

Do not point every frontend or integration test at the live model.

A better workflow:

  1. Define the expected response schema.
  2. Generate a mock server.
  3. Point local development to the mock endpoint.
  4. Use the real Grok 4.5 endpoint only for prompt and model evaluation.

With Apidog, you can generate a mock server from the response schema and avoid spending tokens on UI iteration. Download Apidog to set this up.

4. Use free access windows while available

Grok Build and Cursor currently include free Grok 4.5 usage. See every current path to use Grok 4.5 free.

For a broader model overview, start with what is Grok 4.5.

FAQ

How much does the Grok 4.5 API cost?

Grok 4.5 costs $2 per million input tokens and $6 per million output tokens. Web/X search tool calls cost $5 per 1,000 calls, and priority processing is billed at 2x standard rates.

Does Grok 4.5 have cached-input pricing?

It is unconfirmed. Some secondary sources report $0.50/M, but xAI’s own pricing page does not list a cached rate for grok-4.5 as of July 9, 2026. Check the xAI console before using cached input in your cost model.

Is Grok 4.5 cheaper than Claude Opus 4.8?

Yes. Sticker pricing is lower: $2/$6 for Grok 4.5 vs $5/$25 for Claude Opus 4.8. The per-task gap can be larger if Grok 4.5 solves your workload with fewer output tokens.

Why is Grok 4.5 more expensive than Grok 4.3?

xAI prices Grok 4.5 as the premium capability model. You pay more per token for higher benchmark scores and reported token efficiency, but you give up half the context window and the listed batch discount available on grok-4.3.

Top comments (0)