All guides
Live pricing researchLatest listed-channel verification Dec 3, 2026

MCP & AI Agent API Cost Guide: Multi-Turn Token Math & Markdown Savings

Published Updated

A single user task executed by an MCP-enabled AI agent (in Cursor, Claude Desktop, Dify, n8n, or a custom loop) rarely equals one LLM call. Instead, it triggers 6–20 sequential turns where every turn resends the system prompt, all attached MCP tool schemas, conversation history, and every previous tool output. Understanding that quadratic input growth—and shrinking tool payloads before they enter context—is the fastest way to cut production agent bills.

Current API price snapshot

Up to 12 tracked language models are shown. Channels are selected by lowest input rate normalized to USD, not lowest total cost. Examples use 1M input plus 250K output tokens, without additional cache, batch or context-tier adjustments or tool fees. Processing-mode variants are not interchangeable; no total is shown when output pricing is unknown.

ModelLowest-input-rate channelInput / 1MOutput / 1MExample cost (USD)ChannelsSelected price verified
Gemini HydrogenOpenRouter$1.50$7.50$3.3751Dec 3, 2026
Gemini CarbonOpenRouter$4.00$20.00$9.001Dec 3, 2026
Gemini NeonOpenRouter$3.00$15.00$6.751Dec 3, 2026
Gemini 4 Carbon (batch)OpenRouter$2.00$10.00$4.501Dec 3, 2026
Gemini 4 CarbonXycAi¥8.28¥41.40$2.705Dec 3, 2026
DeepSeek V4.1 FlashOpenRouter$0.02$0.20$0.071Dec 3, 2026
DeepSeek V4.1 Flash 1017词元所¥0.80¥3.20$0.23191Nov 12, 2026
Gemini 4 ArgonXycAi¥8.28¥41.40$2.705Dec 3, 2026
Gemini 4 Argon BatchOpenRouter$2.00$10.00$4.501Dec 3, 2026
Claude Sonnet 5.5 BatchOpenRouter$1.00$5.00$2.251Dec 3, 2026
Claude Sonnet 5.5XiuRouter$0.60$3.00$1.353Dec 3, 2026
DeepSeek ProOpenRouter$0.12$4.40$1.21881Dec 3, 2026

The multi-turn compounding formula for MCP agents

Suppose an agent starts with S tokens of system instructions and MCP tool schemas, executes N turns, and appends an average of D tokens (tool output + assistant step) on each turn. Total input tokens across the task are approximately N × S + D × N × (N − 1) / 2.

Notice the N² term on D: if an early web-fetch or PDF-read tool injects 20,000 tokens of noisy HTML or raw layout tags into a 10-turn workflow, that single bloated tool output generates 20,000 × 9 = 180,000 cumulative input tokens before the task finishes. Converting the same source to clean Markdown (cutting payload size by 45% to 11,000 tokens) eliminates 81,000 cumulative input tokens in just one agent run.

Three high-leverage levers: Prompt Caching, meta-tool MCP, and Markdown outputs

First, keep system instructions and MCP tool lists byte-identical across turns so providers deliver 65%–85% cached-input reads (avoid injecting live timestamps into the top of the system prompt).

Second, avoid attaching dozens of unused MCP tools to every prompt; use lazy discovery / meta-tool MCP servers (search_tools -> get_tool -> run_tool) so S stays compact.

Third, ensure document and web tools return clean Markdown instead of raw HTML or unparsed file dumps—for example, calling a dedicated MCP tool like document_to_markdown on toolkit.fun/document-to-markdown (including Pro high-accuracy mode for complex PDF tables and scans) keeps every downstream turn concise.

Model routing: pair cheap tool-orchestration turns with flagship synthesis

Not every turn in an MCP workflow needs the most expensive flagship model. Routine steps—such as deciding which search query to run, extracting fields from a converted Markdown table, or formatting JSON arguments—run reliably on Flash/Mini or DeepSeek-class models at a fraction of flagship rates.

Reserving flagship Claude or GPT models for final synthesis, complex architectural planning, or high-stakes code edits routinely cuts blended workflow cost by 40%–70%. Model your exact turn volume and cache rate in our MCP & AI Agent Workflow cost calculator.

How to use this data

  • Recalculate with your real input/output token mix.
  • Check region, rate limits, and payment method.
  • Recheck official sources before purchasing or switching.

Frequently asked questions

Why are AI agent API bills so much higher than single-turn chat estimates?

Because an agent loops 6–20 times per task and resends the entire growing transcript plus tool schemas on every turn. Even a modest 2,000-token tool response paid across 10 subsequent turns adds 20,000 input tokens per task.

How much does Prompt Caching save on MCP agent workflows?

When system prompts, tool schemas, and prior turns stay immutable, multi-turn agent loops typically achieve 65%–85% cached input reads. On channels offering 75%–90% cache-read discounts, that cuts effective input spend dramatically—provided you do not bust the prefix between turns.

How does converting PDFs or web pages to Markdown help an MCP agent?

Converting raw PDFs, Office files, or web pages into clean Markdown before injecting them into the agent transcript cuts tool-output tokens by 35%–60%—and because agent turns resend prior tool outputs repeatedly, that single cleanup multiplies across every remaining turn in the run.

Official sources and review date

Billing guidance reviewed: . Price verification dates are listed separately in the table.