Claude Opus 4.8 API

Call Claude Opus 4.8 with one TokenMilo API key. Frontier Claude models for complex coding, agents and analysis. Billed per token at 79% below the official Anthropic price.

Get an API key

Model IDclaude-opus-4-8
ProviderAnthropic
FamilyClaude Opus
Discount79% off official

Claude Opus 4.8 pricing

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

TokenMiloOfficial AnthropicYou save
Input$1.06$5−79%
Output$5.33$25−79%
Cache read$0.108$0.5−78%
Cache write (5 min)$1.33$6.25−79%
Cache write (1 hour)$1.33$10−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$4.79$22.50$17.71
1,000 requests × 50,000 in / 2,000 out tokens$63.76$300$236

Claude Opus price comparison: TokenMilo vs official

ModelTokenMilo in / outOfficial in / outSaved
Claude Opus 5.5$0.855 / $4.26$4 / $20−79%
Claude Opus 5$1.06 / $5.33$5 / $25−79%
Claude Opus 4.8 (this page)$1.06 / $5.33$5 / $25−79%
Claude Opus 4.7$1.06 / $5.33$5 / $25−79%
Claude Opus 4.6$1.06 / $5.33$5 / $25−79%

Claude Opus 4.8 use cases

Coding agents

Run Claude Code, Cline or Cursor on Opus for complex features, tricky bugs and multi-file changes.

Debugging and architecture

Read stack traces, logs and unfamiliar code, then propose and implement the fix.

Long documents and data analysis

Summarise reports, compare contracts, analyse spreadsheets and write up the findings.

Tool use and workflows

Reliable function calling for multi-step automations and internal tools.

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-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude Opus 4.8!"}]
  }'

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-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain prompt caching in one paragraph."}],
)
print(msg.content[0].text)

Use Claude Opus 4.8 in your tools

More Anthropic models

Common Claude Opus 4.8 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-opus-4-8 — 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 Opus 4.8?

Yes. Requests with model ID claude-opus-4-8 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 Opus 4.8 cost on TokenMilo?

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

Which API format should I use for Claude Opus 4.8?

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 Opus 4.8 support prompt caching?

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

Start using Claude Opus 4.8

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

Get an API key All models Full pricing