How much does a Claude Code session cost with an API key?
wiozen-coder model. As of 8 November 2026 it costs, per 1 million tokens, $0.05 for input, $0.005 for input read from the cache, $0.0625 for input written to the cache and $0.20 for output. A session costs the sum of those four lines. For example, a session with 1.5 million cached input tokens, 150 thousand fresh input tokens, 50 thousand cache-write tokens and 60 thousand output tokens comes to about $0.03. You can see the real cost of your own session, request by request, on the Usage page.What makes up the cost?
On every turn Claude Code resends the whole conversation, the files it has opened and its tool definitions. Part of that is repeated word for word from the previous turn and is read from the cache; the newly added part counts as fresh input. Everything the model writes is output. Wiozen bills each request by these numbers in the response:
| Line | Price per 1M tokens | When it happens |
|---|---|---|
| Fresh input | $0.05 | New text that isn't cached: your message, a newly read file, a tool result |
| Cache read | $0.005 | The part repeated unchanged from the previous turn |
| Cache write | $0.0625 | The part stored in the cache to be reused on the next turn |
| Output | $0.20 | The model's answer, the code it writes and its tool calls |
Prices are as of 8 November 2026; the current ones are on the Models page. The context window is 200 thousand tokens. A cache write with the longer (1-hour) lifetime is charged at twice the input price, $0.10.
A worked example
The numbers below are an example, not a measured average. Picture a session of about forty turns that changes a few files in a medium-sized project:
| Line | Tokens | Cost |
|---|---|---|
| Cache read | 1,500,000 | $0.0075 |
| Fresh input | 150,000 | $0.0075 |
| Cache write | 50,000 | $0.0031 |
| Output | 60,000 | $0.0120 |
| Total | 1,760,000 | $0.0301 |
Most of the tokens are cache reads, but the biggest share of the cost is output. Sessions where Claude Code writes a lot of code lean towards output; sessions that read many files and write little lean towards input. The formula itself is in the API cost guide.
Why does a session get more expensive as it grows?
Each turn carries the full history of the turns before it. The request on turn ten contains the first nine turns; the request on turn twenty contains the first nineteen. The cache cuts the price of that repetition to a tenth but doesn't remove it, so total input grows with every turn.
When the task changes, starting a new session or clearing the history with Claude Code's /clear command makes the following turns cheaper. /compact summarises and shortens the history; the summary is a request too and is billed like one. How the cache works is explained in the caching guide.
How do I track and cap the spend?
The Usage page shows every request on its own row: fresh input, cache read, cache write, output and cost. To get the total for a session, add up the rows from those hours.
If you create a separate key for Claude Code and label it claude-code, the Keys page shows that key's spend on its own. On the same page you can give the key a spend limit in dollars. When the limit is reached only that key stops; keys for your other tools keep working.
When the balance runs out the API returns 429 and Claude Code shows an error. Top up and you carry on where you left off; details are in the 429 guide. The minimum top-up is $5. Card top-ups currently work only from Turkey, with a card issued in Turkey.
Frequently asked questions
Which model does Claude Code use on Wiozen?
wiozen-coder. As of 8 November 2026 it costs $0.05 input and $0.20 output per 1M tokens.How much does an average Claude Code session cost?
Is caching billed separately?
How do I stop one session from using up my whole balance?
What happens when the balance runs out?
For setup see the Claude Code page; the detailed settings are in the Claude Code address and key guide.
Create your accountMore 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 · Can you use Claude Code without a subscription and pay only for what you use? · How much does prompt caching cut API costs? Cache read and cache write prices · 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?