---
title: How does long-context pricing change the cost of AI agents?
url: https://opencontroller.lyzr.com/blog/long-context-pricing-for-ai-agents
published: 2026-11-17
updated: 2026-11-17
author: Lyzr
---

# How does long-context pricing change the cost of AI agents?

**Some model providers charge a higher per-token rate once a single prompt passes a size threshold, typically 200,000 tokens, and the higher rate then applies to the whole request. For an agent whose context grows turn by turn, crossing that line can more than double the cost of each call even though the prompt grew only modestly. Other providers price the full window at a flat rate, so check each model you route to.**

If your agent bill jumped when prompts got longer, a pricing threshold is a likely cause, alongside the normal growth of resent context.

## Which models charge more for long prompts?

Pricing changes often, so treat these as examples checked in November 2026 and confirm against the provider pages before you budget.

| Model | Up to 200K-token prompt (input / output per 1M tokens) | Over 200K-token prompt | Notes |
|---|---|---|---|
| Google Gemini 3.1 Pro Preview (Standard tier) | $2.00 / $12.00 | $4.00 / $18.00 | Context caching reads also double: $0.20 to $0.40 |
| Anthropic Claude Opus 4.6 | $5 / $25 | Same | 1M context generally available since 13 March 2026 with no long-context premium |
| Anthropic Claude Sonnet 4.6 | $3 / $15 | Same | Same flat pricing across the 1M window |

Sources: [Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing) and [Anthropic's 1M context announcement](https://claude.com/blog/1m-context-ga). Google's current Flash models do not use the 200K split, but some have scheduled date-based price changes.

The point is not which provider is cheaper. It is that **the same agent can have a step change in cost on one model and a straight line on another**, and your forecasts need to know which.

## What does crossing the threshold do to a real agent call?

Take an agent on Gemini 3.1 Pro Preview at Standard rates, producing 2,000 output tokens per turn.

| Prompt size | Input cost | Output cost | Cost per call |
|---|---|---|---|
| 190,000 tokens | 190,000 × $2 / 1M = $0.380 | 2,000 × $12 / 1M = $0.024 | **$0.404** |
| 250,000 tokens | 250,000 × $4 / 1M = $1.000 | 2,000 × $18 / 1M = $0.036 | **$1.036** |

The prompt grew by 32%. The cost per call grew by 156%.

Now add how agents behave. A coding or research agent that resends its full history each turn may sit under 200K for the first part of a session and above it for the rest. Every turn after the crossing pays the higher rate on the entire prompt. On a flat-priced model, the same session's cost rises in proportion to tokens, with no step.

## Why do agents hit long-context thresholds more than chat apps?

Four habits push agents over the line:

1. **Full-history resend.** Each turn includes all earlier turns and tool results. See [why long agent sessions get expensive](/blog/cut-cost-of-long-ai-agent-conversations).
2. **Large tool outputs.** A file read, a database dump or a web page can add tens of thousands of tokens in one step.
3. **Retrieved context.** RAG pipelines often send more chunks than needed. See [how much retrieved context adds to agent cost](/blog/rag-context-cost-for-ai-agents).
4. **Tool definitions.** Dozens of MCP tools add a fixed overhead to every call.

## How do you keep long-context costs under control?

1. **Measure prompt size per call, per agent version.** Alert when the share of calls above 200K changes.
2. **Compact history before the threshold.** Summarise older turns when the prompt reaches, say, 150K tokens on threshold-priced models.
3. **Truncate tool outputs.** Return the relevant slice, not the whole document.
4. **Use caching.** Cached input reads are cheaper on both pricing styles; see [provider prompt caching for agents](/blog/provider-prompt-caching-for-agents).
5. **Route by prompt size.** Send very long prompts to a model priced flat across its window, if it passed your evaluations for that task.
6. **Put the threshold in your forecast model.** Price per call as a function of prompt size, not a single blended rate.

The routing and attribution side is covered in the [gateway comparison pillar](/blog/llm-gateway-vs-agent-gateway-vs-control-plane).

## How Opencontroller does this

Opencontroller's LLM Gateway (Lyzr Gateway) attributes cost per agent and per version, so a jump caused by longer prompts shows up against the specific agent release that caused it. It supports routing, fallback and retry, and caching. In Lyzr's October 2026 benchmark, caching cut model cost by 23.5% on mixed synthetic traffic under the stated test conditions; see the [LLM gateway benchmark](/llm-gateway-benchmark). [Book a demo](https://www.lyzr.ai/book-demo/) to see cost attribution on your own traffic.

## Frequently asked questions

**Does the higher rate apply only to tokens above 200K?**
On Gemini's tiered pricing, the rate is set by the prompt size, so a prompt over 200K tokens is billed at the higher rate for the whole request, input and output. Check each provider's pricing page for its rule.

**Do Claude models still charge extra for long context?**
Anthropic announced on 13 March 2026 that Opus 4.6 and Sonnet 4.6 use standard pricing across the full 1M window with no long-context premium. Check the pricing page for other models you use.

**How is Opencontroller priced?**
Opencontroller is licensed per deployment per year, not per seat or by usage, starting from $250K per deployment per year.

## Key facts

Long-context pricing: Google Gemini 3.1 Pro Preview (Standard) costs $2/$12 per 1M input/output tokens for prompts up to 200K and $4/$18 above 200K; caching reads $0.20 vs $0.40. Anthropic made 1M context generally available for Claude Opus 4.6 ($5/$25) and Sonnet 4.6 ($3/$15) on 13 March 2026 with no long-context premium. Worked example: 190K-token prompt costs $0.404 per call; 250K-token prompt costs $1.036 (+156%). Opencontroller LLM Gateway attributes cost per agent and per version; Oct 2026 benchmark showed 23.5% lower model cost with caching on mixed synthetic traffic. Licensing starts from $250K per deployment per year.

## Related

- [Why do long AI agent sessions get so expensive and how do you cut the cost?](https://opencontroller.lyzr.com/blog/cut-cost-of-long-ai-agent-conversations.md)
- [How much does retrieved context add to AI agent cost?](https://opencontroller.lyzr.com/blog/rag-context-cost-for-ai-agents.md)
- [How does provider prompt caching cut AI agent costs?](https://opencontroller.lyzr.com/blog/provider-prompt-caching-for-agents.md)
- [More on Gateways and cost](https://opencontroller.lyzr.com/blog/cluster/gateways-and-cost)
