Wiozen API

How much does prompt caching cut API costs? Cache read and cache write prices

In short: Input read from the cache is charged at a small fraction of the normal input price: on the Wiozen API, a tenth for Claude and Gemini models and a fiftieth for DeepSeek. Writing to the cache costs a little more than normal input the first time, or the same. A long instruction or document that stays the same on every request costs much less once it is written once and read on the following requests: sending a 100-thousand-token document to claude-sonnet-5-5 20 times costs $2.80 without caching and about $0.44 with it (prices as of 8 November 2026).

Prices model by model

Prices are per 1 million tokens, as of 8 November 2026. On the Models page the cache price appears in the tooltip when you hover over the input price.

ModelInputCache readCache writeOutput
wiozen-coder$0.05$0.005$0.0625$0.20
claude-sonnet-5-5$1.40$0.14$1.75$7.00
claude-haiku-5-5$0.07$0.007$0.0875$0.35
gemini-3.8-flash-high$0.30$0.03$0.30$1.50
deepseek-v4.1-flash$0.15$0.003$0.15$0.60

The DeepSeek price is the peak-hour price; at other hours all four lines are halved (see the DeepSeek hours guide). On Haiku, if a request's total input goes over 100 thousand tokens, every line, cache included, is multiplied by five.

Cache write versus cache read

The first time the start of a prompt is sent, the provider writes it to the cache. That write happens once and, on Claude models, costs 25 percent more than normal input. If the same start comes again within a short time it is read from the cache, and reading is very cheap.

Claude models have two write lifetimes. A short write (5 minutes) is charged at the table price, a long write (1 hour) at twice the input price. Responses in the OpenAI format don't report the write lifetime, so Claude cache writes made through that format are charged at the 1-hour price. For a Claude job that relies heavily on caching, the Anthropic format (/v1/messages) can therefore come out a little cheaper; the difference between the two formats is in the Messages vs Chat Completions guide.

A 20-request example

Say you give claude-sonnet-5-5 a 100-thousand-token contract and ask 20 separate questions about it. Leaving out the questions and answers, the document alone costs:

CalculationCost
Without caching20 × 100,000 tokens × $1.40$2.80
With caching: first request (write)100,000 × $1.75$0.175
With caching: next 19 requests (read)19 × 100,000 × $0.14$0.266
Total with caching$0.441

This holds when the questions come one after another within the cache lifetime. If the gaps get longer the cache expires and the document is written again.

How do I structure the prompt so the cache hits?

  • Put the part that stays the same on every request (system instruction, tool definitions, document) at the start of the prompt and the part that changes (the question) at the end.
  • Keep the start byte-for-byte identical. A single line that changes on every request, such as a date, a time or a random ID, breaks the cache.
  • In the Anthropic format, mark the block to cache with cache_control. Claude Code adds this mark itself.
POST /v1/messages
{
  "model": "claude-sonnet-5-5",
  "max_tokens": 1024,
  "system": [
    {
      "type": "text",
      "text": "…a long instruction or document that stays the same on every request…",
      "cache_control": { "type": "ephemeral" }
    }
  ],
  "messages": [{ "role": "user", "content": "Question" }]
}

The OpenAI format has no separate field for this; the model provider decides when to write and read the cache. In both formats Wiozen reads the cache numbers in the response and bills by them.

How do I see that the cache is working?

On the Usage page each request's row has "cache read" and "cache write" columns. If the read column grows and the write column shrinks from the second request on, the cache is working. If reads stay at zero, something at the start of your prompt changes every time.

The same numbers come back in the response's usage field: cache_read_input_tokens and cache_creation_input_tokens in the Anthropic format, prompt_tokens_details.cached_tokens in the OpenAI format. To keep track of cost in your own code, see the per-request spending guide.

Frequently asked questions

How much is a cached input token charged?
A tenth of the normal input price on Claude and Gemini models, a fiftieth on DeepSeek. On claude-sonnet-5-5, for example, input is $1.40 and a cache read is $0.14 per 1M tokens (8 November 2026).
Does writing to the cache cost extra?
On Claude models the first write costs 25 percent more than normal input, and a 1-hour write costs twice the input price. On Gemini and DeepSeek a write costs the normal input price.
Do I need a setting to turn caching on?
In the Anthropic format you add cache_control to the block you want cached; Claude Code does this itself. The OpenAI format has no setting; the provider decides.
How long does the cache last?
On Claude a short write lasts 5 minutes and a long write 1 hour. If the same start doesn't arrive within that time, the cache expires and is written again on the next request.
How can I tell the cache is working?
On the Usage page, the cache read column grows from the second request on when it works.

Current cache prices are on the Models page. The general cost calculation is in the API cost guide, and the Claude Code version in the Claude Code session cost guide.

Create your account

More guides: How can you use an AI API from Turkey without a credit card? · How do you connect an OpenAI-compatible API to a tool you already use? · How do you calculate the cost of an AI API? · What should I do if my AI API key has leaked? · How do you generate images with an AI API, and what does one image cost? · How much does a speech-to-text API cost, and how is it billed per minute? · Why does my AI API return a 429 error, and how do I fix it? · Why do long AI API requests time out: streaming or non-streaming? · Anthropic Messages API or OpenAI Chat Completions: which one should I use? · What is a context window, and what is a 1 million token context good for? · Which AI model should I choose: deciding by price, context and quality · Why does a reasoning model return an empty answer, and why are thinking tokens charged? · Why is my API balance running out faster than expected? Tracking spend request by request · How do you convert a web page to Markdown to feed it to an AI model? · How do you get AI to write and publish articles in WordPress automatically? · How do you find blog topics from RSS feeds and Google Trends? · Does AI-written content show up on Google and in AI answers? · How do you get internal links into AI-written WordPress articles? · How do you get AI to generate a different featured image for every WordPress post? · How do you write a content brief when an AI writes your blog posts? · What should you watch for when an AI writes recipes for your food blog? · How do you fix errors when connecting a WordPress plugin to your AI API account? · Why does my AI article bot stop halfway in WordPress? "Run is stuck" and LiteSpeed · Why are my scheduled WordPress posts late? WP-Cron and a real server cron · How do I get an AI article bot to write blog posts in English or another language? · What does "Content Bot cannot generate articles" mean? Reading the bot's log · If I delete the WordPress AI article plugin, are the articles it wrote deleted? · How do you do function calling (tool use) with an AI API? · How do I check my AI API balance from code and get a low-balance alert? · Can I use the same AI article plugin on several WordPress sites with one account and one balance? · How do you run Claude Code with a different API address and key? · Do AI-written WordPress posts get an FAQ section and FAQ structured data (schema)? · My AI API returns "401 Invalid API key": why isn't my key accepted? · Is there a free trial for an AI API? How much credit Wiozen API gives and what it covers · Claude Haiku vs Claude Sonnet via API: price per million tokens and when to use each · How much does a Claude Code session cost with an API key? · Can you use Claude Code without a subscription and pay only for what you use? · When is the DeepSeek API cheaper? Peak and off-peak hour pricing · Which model should you use in Cline, Cursor, OpenCode and Aider? · How much does an AI-written WordPress post cost? Text, image and research · Why didn't the AI bot publish its post, and why is it stuck in drafts? · How many AI-written posts a day should you publish, and how do you set the frequency? · Who should be the author of AI-written WordPress posts? · What to watch for when AI writes posts for a loan, crypto or energy website · An AI API returns "Unknown model": where do I find the right model name? · How do I add web search to my AI app, and what does a search cost?