Wiozen API

Claude Haiku vs Claude Sonnet via API: price per million tokens and when to use each

In short: On the Wiozen API, as of November 6, 2026, claude-haiku-5-5 costs $0.07 per million input tokens and $0.35 per million output tokens; claude-sonnet-5-5 costs $1.40 and $7.00. Sonnet is 20 times Haiku on both. Use Haiku for short, well-defined jobs whose output you can check: classification, extracting data into JSON, routing, short chat replies, summaries. Use Sonnet for code changes that touch several files, agent loops that call tools, and tasks that need several steps of reasoning. Both have a 1M-token context window, and you switch between them by changing the model field.

Prices side by side

Per 1M tokensclaude-haiku-5-5claude-sonnet-5-5
Input$0.07$1.40
Output$0.35$7.00
Cache read$0.007$0.14
Cache write$0.0875$1.75
Context1M1M
Input over 100K tokensevery line ×5: input $0.35, output $1.75no change

These are the prices shown on the Models page on November 6, 2026. The page lists them as 30% below the official list price, and they can change. Cache prices appear when you hover over the input price on that page.

The last row applies only to Haiku. If a request's total input (including tokens read from or written to the cache) goes over 100,000 tokens, every line of that request is billed at five times the price. At 100,000 or below, the normal price applies. Sonnet has no such step. Even at five times, Haiku costs a quarter of Sonnet.

Which tasks fit Haiku?

Jobs where the answer is short, there's one clear right answer, and you can check the result in code. Putting a support ticket into one of five categories, pulling a name, address and company out of an email as JSON, tagging an incoming request with the flow it should go to, summarizing a page in three sentences, reshaping a product description into a fixed template. These jobs run in high volume, and a 20× price gap decides the monthly bill.

Haiku also works well for helper steps inside a bigger agent: choosing relevant files by name, shortening tool output, cleaning up text before it goes to the next step.

Which tasks need Sonnet?

Jobs where the model has to follow a plan across several steps. Code edits that change several files together, agent loops that call a tool and pick the next tool based on the result, reading a long contract and connecting clauses to each other, tracking down the root cause of a bug by going back and forth between logs and code. In this kind of work a wrong answer usually costs more than the tokens: reruns, review time, a broken build.

The quickest way to decide is to test with your own data. Take 20–50 real examples from your workload, run them on both models and compare the results side by side. If Haiku is good enough, the extra you'd pay for Sonnet buys nothing.

What does the same job cost on each?

Batch classification. 10,000 support tickets of 400 input tokens each, and the answer is a single label (10 output tokens). That's 4,000,000 input and 100,000 output tokens in total.

  • claude-haiku-5-5: 4,000,000 × 0.07 / 1,000,000 = $0.28 input, 100,000 × 0.35 / 1,000,000 = $0.035 output, $0.315 in total.
  • claude-sonnet-5-5: $5.60 input, $0.70 output, $6.30 in total.

A long document. A 150,000-token contract and a 2,000-token summary.

  • claude-haiku-5-5, one request: the input is over 100K, so 150,000 × 0.35 + 2,000 × 1.75, divided by 1,000,000 = $0.0525 + $0.0035 = $0.056.
  • claude-sonnet-5-5, one request: 150,000 × 1.40 + 2,000 × 7.00, divided by 1,000,000 = $0.21 + $0.014 = $0.224.
  • claude-haiku-5-5, document split in two (two requests of 75,000 input and 1,000 output tokens): 2 × ($0.00525 + $0.00035) = $0.0112.

If the job can be split (summarizing each section separately, for example), keeping Haiku requests at or under 100,000 tokens cuts the cost to a fifth. When the sections depend on each other (whether one clause overrides another, for example), the whole document has to stay in one request. The formula itself and the effect of caching are in the cost calculation guide.

How do I switch models?

Both models use the same key, the same address and the same balance. To switch, you change only the model field in the request. That makes it easy to use both in the same code: try the cheap model first, and if the result fails your check, send the same request to Sonnet. With the OpenAI SDK:

extract.py
import json
from openai import OpenAI

client = OpenAI(base_url="https://api.wiozen.com/v1", api_key="sk-gw-...")

def extract(text: str) -> dict:
    prompt = "Return only JSON with the keys name, email, company.\n\n" + text
    for model in ("claude-haiku-5-5", "claude-sonnet-5-5"):
        r = client.chat.completions.create(
            model=model,
            messages=[{"role": "user", "content": prompt}],
            max_tokens=300,
        )
        try:
            return json.loads(r.choices[0].message.content)
        except json.JSONDecodeError:
            continue  # Haiku didn't return valid JSON: send the same request to Sonnet
    raise ValueError("neither model returned valid JSON")

With this setup most requests finish at Haiku's price, and only the ones Haiku can't handle go to Sonnet. The same field works in the Anthropic Messages format:

terminal
curl https://api.wiozen.com/v1/messages \
  -H "x-api-key: $API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-haiku-5-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Classify this ticket as billing, technical or refund."}]
  }'

The model name has to match the Models page exactly; any other name returns 400, and the error message lists the valid names. Connection steps are in the guide to connecting an OpenAI-compatible API.

Can I pick Haiku or Sonnet in Claude Code?

Not through Wiozen at the moment. On Wiozen, Claude Code currently works only with the wiozen-coder model; the setup is in the Claude Code guide. The choice in this article applies to your own code and to tools that send requests in the OpenAI or Anthropic format. For a comparison with the other models in the catalog, see which AI model to choose.

Frequently asked questions

How much cheaper is Claude Haiku than Claude Sonnet?
On the Wiozen API, as of November 6, 2026, 20 times cheaper on input, output and cache prices alike: Haiku $0.07 / $0.35, Sonnet $1.40 / $7.00 per 1M tokens. Haiku requests with more than 100K input tokens are billed at five times; even then Haiku is a quarter of Sonnet's price.
Do Haiku and Sonnet have the same context window?
Yes, both have 1M tokens.
Can I use both with the same API key?
Yes. The key and the balance are shared across all models; you pick the model per request with the model field.
Is Haiku good enough for coding?
For a single function, a short script or explaining an error message, it often is. For changes across several files and for agent loops that call tools, start with Sonnet.
Can I use Sonnet in Claude Code?
Not on Wiozen at the moment; Claude Code works only with wiozen-coder.

See both models on the Models page and try them on your own examples with the same key.

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 · 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? · 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?