Claude Haiku 4.5 API

Call Claude Haiku 4.5 with one TokenMilo API key. The fastest and cheapest Claude models, for high-volume and latency-sensitive work. Billed per token at 79% below the official Anthropic price.

Get an API key

Model IDclaude-haiku-4-5
ProviderAnthropic
FamilyClaude Haiku
Discount79% off official

Claude Haiku 4.5 pricing

USD per 1M tokens. Prices updated 2026-11-13.

TokenMiloOfficial AnthropicYou save
Input$0.216$1−78%
Output$1.06$5−79%
Cache read$0.022$0.1−78%
Cache write (5 min)$0.27$1.25−78%
Cache write (1 hour)$0.27$2−87%

Official cache prices follow Anthropic’s published multipliers (read 0.1×, 5-min write 1.25×, 1-hour write 2× the input price). On TokenMilo, 1-hour cache writes cost the same as 5-minute writes.

What it costs in practice

WorkloadTokenMiloOfficialYou save
1,000 requests × 2,000 in / 500 out tokens$0.963$4.50$3.54
1,000 requests × 50,000 in / 2,000 out tokens$12.92$60.00$47.08

Claude Haiku price comparison: TokenMilo vs official

ModelTokenMilo in / outOfficial in / outSaved
Claude Haiku 5.5$0.108 / $0.531$0.5 / $2.5−79%
Claude Haiku 4.5 (this page)$0.216 / $1.06$1 / $5−79%

Claude Haiku 4.5 use cases

Classification and extraction

Tag tickets, detect intent, and pull fields out of emails and invoices into JSON.

High-volume batch jobs

Process huge numbers of short items cheaply — moderation, cleaning, summarising.

Real-time chat and autocomplete

Low-latency replies where a user is waiting on the other end.

Sub-agents and routing

A cheap worker or router model inside larger agent systems, such as background tasks in Claude Code.

Supported endpoints

Anthropic Messages · recommendedPOST https://api.tokenmilo.com/v1/messages
OpenAI Chat CompletionsPOST https://api.tokenmilo.com/v1/chat/completions

Base URL and API key are the same for every format. API guide →

Code examples

curl

curl https://api.tokenmilo.com/v1/messages \
  -H "x-api-key: $TOKENMILO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-haiku-4-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude Haiku 4.5!"}]
  }'

Python

# pip install anthropic
import os, anthropic

client = anthropic.Anthropic(
    base_url="https://api.tokenmilo.com",
    api_key=os.environ["TOKENMILO_API_KEY"],
)
msg = client.messages.create(
    model="claude-haiku-4-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain prompt caching in one paragraph."}],
)
print(msg.content[0].text)

Use Claude Haiku 4.5 in your tools

More Anthropic models

Common Claude Haiku 4.5 API errors and how to fix them

Most errors come from the key, the base URL or the model ID. Check these first:

401 Unauthorized / invalid API key

Cause: The key is wrong, has an extra space or line break, was deleted, or is an official Anthropic/OpenAI key instead of a TokenMilo key.

Fix: Copy the key again from the Tokens page of the console (it starts with sk-). In Claude Code, set it as ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY — not both with different values.

The response is an HTML page, or "Unexpected token <" / JSON parse error

Cause: The base URL points at the website instead of the API, or has a typo.

Fix: Anthropic format: use https://api.tokenmilo.com (SDKs add /v1/messages themselves). OpenAI format: use https://api.tokenmilo.com/v1. If a tool asks for a single URL, https://api.tokenmilo.com/v1 works for both.

model_not_found / "no available channel for model"

Cause: The model name is misspelled, has the wrong case, or includes a vendor prefix.

Fix: Use the exact model ID claude-haiku-4-5 — lowercase, with no prefix such as anthropic/ or openai/.

Insufficient quota / balance

Cause: Your account balance is used up, or the key has its own spending limit that has been reached.

Fix: Top up in the console, or edit the key and raise or remove its quota limit.

Connection error, timeout, ECONNRESET or "fetch failed"

Cause: A local proxy (for example Clash in fake-ip mode) or a firewall is intercepting the connection.

Fix: Set api.tokenmilo.com to DIRECT in your proxy rules, or turn the proxy off. TokenMilo does not need a proxy.

429 Too Many Requests

Cause: Too many concurrent requests in a short time.

Fix: Retry with exponential backoff and lower the concurrency of batch jobs.

Context too long ("prompt is too long" / context_length_exceeded)

Cause: The conversation plus attached files exceeds the model’s context window.

Fix: Start a new session or run /compact in Claude Code, attach fewer files, and trim long tool outputs.

400 "max_tokens: Field required"

Cause: The Anthropic Messages API requires max_tokens on every request.

Fix: Add max_tokens (for example 1024 or more) to the request body. OpenAI-format requests don’t need it.

400 tool_choice not supported

Cause: Some newer Claude models (for example Claude Sonnet 5.5) only accept tool_choice "auto"; forcing a specific tool or "any" is rejected upstream.

Fix: Use tool_choice "auto" (or omit it), or switch to a model that supports forced tool use, such as claude-sonnet-4-6.

500 / 502 / 503 upstream error

Cause: A temporary error from the upstream model provider.

Fix: Retry after a few seconds. If it keeps failing for several minutes, contact support with the time and request ID.

Still stuck? Ask in our Telegram support group and we will help, including remote setup. Telegram →

FAQ

Is this the real Claude Haiku 4.5?

Yes. Requests with model ID claude-haiku-4-5 are served by the genuine Anthropic model — no quantized, swapped or downgraded variant. Response quality is the same as calling Anthropic directly.

How much does Claude Haiku 4.5 cost on TokenMilo?

$0.216 per 1M input tokens and $1.06 per 1M output tokens, compared with $1 / $5 officially — 79% less. There is no subscription or monthly minimum.

Which API format should I use for Claude Haiku 4.5?

The Anthropic Messages API (https://api.tokenmilo.com/v1/messages) is recommended and supports every Claude feature, including prompt caching, tool use and extended thinking. The OpenAI-compatible Chat Completions endpoint also works for simple chat.

Does Claude Haiku 4.5 support prompt caching?

Yes. Cache reads are billed at $0.022 per 1M tokens, which makes long system prompts and coding-agent sessions much cheaper.

Start using Claude Haiku 4.5

Sign up, top up, create a key — and point your SDK at TokenMilo.

Get an API key All models Full pricing