Who this is for and what you will be able to do
This article is for people who run agents or API jobs and want to know where the money goes. After reading it you should be able to read the per-million-token prices of current Claude and GPT models, work out what prompt caching and batch processing change, and set up a first cache breakpoint. It does not cover how to build an agent.
What the three levers are
Cost comes down to three levers: which model handles each task, how much repeated context is re-sent, and whether a job needs an immediate answer. Anthropic's pricing page gives direct advice on the first two. It recommends Haiku for simple tasks, Sonnet for most production workloads and Opus for the most complex reasoning. It also recommends prompt caching for repeated context and the Batch API for non-time-sensitive tasks, and it advises monitoring token consumption.[2] OpenAI's pricing and guides offer the same two mechanisms, caching and batch, under their own names and rules.[5][6][7]
Preparation
Prices on both platforms are quoted per million tokens. The Anthropic pricing page states that all prices are in USD and that MTok means million tokens, so $5 / MTok is $5 for every million tokens.[2] OpenAI's pricing page gives prices per 1M tokens and splits them into short context, up to 272K input tokens, and long context, above 272K input tokens.[5]
Usage tracking for Anthropic is in the Claude Console. The billing page at platform.claude.com/settings/billing is where you buy credits or manage payment methods.[2]
Reading the price tables
On the Anthropic table, Claude Haiku 5.5 costs $0.10 / MTok for base input and $0.50 / MTok for output when the prompt is up to 100,000 tokens. Above 100,000 tokens it costs $0.50 / MTok input and $2.50 / MTok output.[2] The same table lists Claude Sonnet 5.5 at $2 / MTok input and $10 / MTok output, and Claude Opus 5.5 at $4 / MTok input and $20 / MTok output. Claude Fable 5.2 is listed at $8 / MTok input and $40 / MTok output. The table also lists Claude Haiku 4.5 at $1 / MTok input and $5 / MTok output, and Claude Sonnet 4.5 at $3 / MTok input and $15 / MTok output.[2]
On the OpenAI table, gpt-6-luna costs $0.10 for short-context input and $0.50 for output, with $0.01 for cached input. gpt-6.1-sol costs $2.00 input and $10.00 output, with $0.10 cached input. gpt-6-astra costs $10.00 input and $50.00 output.[5] The table also lists gpt-5-nano at $0.05 input and $0.40 output, and gpt-5.4-mini at $0.75 input and $4.50 output.[5] Regional processing endpoints are charged a 10% uplift for models released on or after March 5, 2026, and FedRAMP endpoints carry the same uplift.[5]
Prompt caching on Claude
Caching works by writing a prefix once and reading it back later. On Anthropic's pricing page, a 5-minute cache write costs 1.25x the base input price and lasts 5 minutes. A 1-hour cache write costs 2x and lasts 1 hour. A cache read costs 0.1x the base input price on most models and lasts as long as the preceding write.[2] On the Claude Opus 5.5 row, 5-minute cache writes are $5 / MTok and cache hits are $0.20 / MTok, a 0.05x multiplier.[2]
The page describes two ways to turn caching on. One is automatic caching, with a single cache_control field at the top level of the request. The other is explicit cache breakpoints, with cache_control placed on individual content blocks.[2] The caching guide says ephemeral is the only supported cache type, with a default 5-minute lifetime. To ask for the longer cache, include "ttl": "1h" in cache_control.[3]
Each prompt has a minimum length before it can be cached. The guide gives 512 tokens for Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5, 1,024 tokens for Claude Sonnet 5, and 4,096 tokens for Claude Haiku 4.5.[3]
Prompt caching on OpenAI
OpenAI enables prompt caching by default for supported models, and reused cached input tokens are discounted by up to 95%.[6] For GPT-5.6 and later, the default cache lifetime is 30m, set through prompt_cache_options.ttl. A write at that lifetime costs 1.25× the uncached input rate. A 12h lifetime is also available, at 2.5×. Reads cost 0.1× the input rate on most of these models and 0.05× on GPT-6.1 Sol and GPT-6.1 Terra, whichever lifetime you choose. Unsupported values return 400 invalid_request_error.[6] For earlier models the guide uses prompt_cache_retention with in_memory or 24h instead.[6]
The guide's minimum cacheable length for GPT-5.6 and later is 1,024 tokens. Cached input tokens still count toward tokens-per-minute limits, and manual cache clearing is not currently available.[6] The prompt cache stores KV tensors rather than the original prompt text, with a maximum retention of 24 hours.[6] To check whether caching is working, use usage.input_tokens_details.cached_tokens and usage.input_tokens_details.cache_write_tokens, and the Prompt Caching Dashboard at https://platform.openai.com/usage?usage_section=prompt-caching.[6]
Batch processing
Anthropic's Message Batches API processes large volumes of Messages requests asynchronously. Most batches finish in less than 1 hour, and all usage is charged at 50 percent of the standard API prices.[4] Results can be read once all messages have completed or after 24 hours, whichever comes first. A batch expires if processing does not finish within 24 hours. Results stay available for 29 days after creation.[4] A single batch is limited to 100,000 Message requests or 256 MB, whichever is reached first. Each request needs a custom_id of 1 to 64 characters matching ^[a-zA-Z0-9_-]{1,64}$. max_tokens: 0 and stream: true are not supported in batch requests.[4] Batch and caching discounts can be combined, and the pricing page says the caching multipliers stack with the Batch API discount.[2]
OpenAI's Batch API works the same way in outline. It sends asynchronous groups of requests with 50% lower costs and a separate pool of higher rate limits. The completion_window can only be set to 24h. A single batch holds up to 50,000 requests with an input file of up to 200 MB, and you can submit up to 2,000 batches per hour. Output and error files expire 30 days after file creation by default.[7] The batch price table lists gpt-6-luna at $0.05 input and $0.25 output for short context.[5]
Our practice
TellWorld runs its searching, fact gathering and first-draft writing on Haiku sub-agents. The more expensive main model handles coordination and spot checks.[1] In the 13 November 2026 news update, one Haiku sub-agent wrote both the Chinese and the English text for all 10 new entries.[1] Each search sub-agent used roughly 135,000 to 146,000 tokens to cover a window of about three and a half days.[1]
We also shrink images before an agent checks them. Each generated image is reduced to 320×180 pixels before the agent looks at it, which saves tokens.[1] The project rule behind all of this is simple: do in one script what would otherwise take several agent turns.[1] These choices fit our workflow, where the steps are fixed and the main model is needed mainly for coordination. They are not a general answer for every agent.
Limits and common problems
- A prompt below the minimum length is not cached. The request is processed without caching and no error is returned. If both
cache_creation_input_tokensandcache_read_input_tokensare0, the prompt was not cached.[3] - The usage of a cache write is reported in
cache_creation_input_tokens, with acache_creationobject that splits it intoephemeral_5m_input_tokensandephemeral_1h_input_tokens. The guide definestotal_input_tokensascache_read_input_tokens + cache_creation_input_tokens + input_tokens.[3] - For batches, most jobs complete within
1 hour, but a batch can expire after24 hours. If you process batches with shared context, the guide suggests considering the1-hourcache duration.[4] - Output files from OpenAI batches expire after
30 daysunless you change the default.[7] - OpenAI's regional endpoints add the
10%uplift described above, so check which endpoint you call.[5]
Next steps
Start with the pricing pages[2][5], then the prompt caching guides[3][6] and the batch guides.[4][7] Begin with one job, measure its token consumption, and only then decide whether caching or batching is worth adding.
Sources
- 1
- 2PricingAnthropic
- 3Prompt cachingAnthropic
- 4Batch processingAnthropic
- 5PricingOpenAI
- 6Prompt cachingOpenAI
- 7Batch APIOpenAI
Cite this page: Keeping agent costs down. TellWorld, https://www.tellworld.net/practice/practice-agent-cost. Updated 2026-11-14