59API

← 返回教程列表

Claude API Pricing: Input, Output & Cache Costs

省钱与定价 · EN · 2026-10-21

Claude API pricing: the five-minute version

Claude API pricing is easier to manage when you separate three things: what the model reads, what it generates, and which prompt content it reuses through caching. A long prompt is not automatically expensive on every request, but caching does not make the entire conversation free.

This quick-start guide explains the billing categories, walks through a cost calculation, and shows how to evaluate a low-cost relay such as 59API without confusing advertised rates with your application's actual spend.

1. Understand the token categories

Tokens are not words. Code, punctuation and non-English text can tokenize differently. Use a token-counting endpoint where supported, then compare estimates with actual response usage.

2. Calculate one request before optimizing

Rates are commonly quoted per million tokens. The basic calculation is cost = uncached input cost + cache-write cost + cache-read cost + output cost. Calculate each component as its token count multiplied by its applicable rate, divided by 1,000,000.

For illustration only, assume input costs $3 per million tokens and output costs $15. With standard Anthropic prompt-caching multipliers, a five-minute cache write would cost $3.75 per million and a cache read $0.30. These are example assumptions, not a live quote for a particular model or relay.

The first cached request costs more, but reuse makes the two-request total cheaper. Longer answers can still dominate the bill.

3. Make your prompt cacheable

Put stable content first: tool definitions, system instructions and reference material. Put changing questions and request-specific data afterward. In Anthropic's native Messages format, supported content blocks can use cache_control with type ephemeral to mark a cache breakpoint.

Cache hits require a matching eligible prefix. Editing instructions, changing tool definitions or rearranging content can cause misses. Models also have minimum cacheable prompt lengths, so short prompts may not qualify.

Standard Anthropic caching uses a five-minute lifetime, with a one-hour option where supported. Five-minute writes typically cost 1.25 times base input, one-hour writes 2 times, and reads 0.1 times. Confirm model support and your provider's billing rules before relying on those multipliers.

4. Connect through 59API and verify billing

59API offers low-cost, pay-as-you-go access to Claude and GPT models, with compatibility for Claude Code, Codex and OpenAI SDK workflows. Its service describes the models as native, official-quality offerings without downgrading, making it an attractive option for cost-conscious developers.

In native Anthropic usage reporting, inspect input_tokens, output_tokens, cache_creation_input_tokens and cache_read_input_tokens. Cache categories are separate from uncached input; avoid double-counting them.

5. Optimize the bill, not just the headline rate

Choose the smallest model that meets your quality target, request concise answers, and track retries and tool-loop costs. Compare total cost per successful task across providers. If that fits your workflow, consider signing up for 59API and testing a small workload; its referral rebate can provide additional savings under the program's terms.

价格 · 接入文档

准备好开始了吗?

几分钟接入 Claude 与 GPT,全网超低价,原生不降智。立即注册即可领取 API 密钥。

免费注册