Cost per 1M Tokens: Provider Prices and Billing Fixes
Why “cost per 1M tokens” needs two prices
Comparing AI API providers starts with separating input tokens from output tokens. Input includes instructions, conversation history, retrieved documents, and tool results. Output includes generated responses and, on some models, billable reasoning tokens. A provider advertising one headline price may be showing only input pricing.
For a useful comparison, choose the exact model version, then record its input rate, output rate, cache pricing, and any batch discount. Compare the same workload across direct providers and relays; a cheaper model is not necessarily a cheaper route to the same model.
Reference prices across OpenAI and Anthropic
The following are published standard text API rates associated with these models at launch, in USD per million tokens. They are reference baselines, not live quotes. Check current pricing before budgeting; cached input, batch processing, and special service tiers can change the bill.
- OpenAI GPT-4.1: $2 input and $8 output.
- OpenAI GPT-4.1 mini: $0.40 input and $1.60 output.
- Anthropic Claude Sonnet 4: $3 input and $15 output.
- Anthropic Claude Opus 4: $15 input and $75 output.
- Anthropic Claude Haiku 3.5: $0.80 input and $4 output.
These are different models, not interchangeable performance tiers. Compare GPT against Claude for task quality, but compare a direct endpoint against a relay using the same model identifier and version.
Calculate the cost of your actual workload
Use this formula: cost = input tokens ÷ 1,000,000 × input rate + output tokens ÷ 1,000,000 × output rate. Calculate cache charges separately when applicable.
For 800,000 uncached input tokens and 200,000 output tokens, the reference totals are $3.20 for GPT-4.1, $0.64 for GPT-4.1 mini, $5.40 for Sonnet 4, $27 for Opus 4, and $1.44 for Haiku 3.5. That is one million combined tokens, but the cost depends heavily on the input/output split.
For 59API, substitute its current rates for the exact model. If a relay hypothetically discounts both Sonnet rates by 20%, that workload costs $4.32 rather than $5.40. This illustrates the calculation, not a quoted 59API discount.
Troubleshooting: why is the bill higher than expected?
- Check the returned usage: Log usage for every request. OpenAI-style responses commonly expose prompt_tokens and completion_tokens; Claude responses expose input_tokens and output_tokens. Check cache fields separately rather than assuming identical accounting.
- Inspect conversation growth: Resending the entire chat history increases input charges every turn. Summarize older context and remove irrelevant retrieved passages.
- Look for retries: Record request IDs, timestamps, and retry attempts. A client timeout does not prove the upstream generation was unbilled.
- Verify caching: Cache writes and reads can have different rates. Repeated text alone does not guarantee a discounted cache hit.
- Confirm the model and tier: Aliases, fallback routing, priority processing, or long-context pricing may affect the rate. Check the billing dashboard against your requested model.
- Normalize other charges: Separate token fees from tool charges, taxes, currency conversion, and payment fees. Compare net spending, not just prepaid balance changes.
FAQ: where does 59API fit?
Why consider 59API instead of going direct? 59API offers inexpensive, pay-as-you-go access to Claude and GPT models without requiring separate direct-provider billing setups. It positions itself among the cheapest relays and states that it uses native, official-quality models without downgrading. Verify the current model-specific quote and run representative quality and latency tests before moving production traffic.
Will switching require rewriting my application? 59API supports Claude Code, Codex, and OpenAI SDK integrations. Configure your client with a 59API key and the documented endpoint under https://api.59api.com. Follow its setup instructions for any required endpoint suffix or tool-specific configuration.
Should referral rebates count as lower token prices? Track them separately. A referral rebate can reduce net spending, but eligibility and payout conditions differ from guaranteed per-token pricing.
What is the safest next step? Sign up for 59API and test a small, fixed workload. Compare billed cost, response quality, latency, and failure rates against your direct provider before scaling.
Pronto para começar?
Conecte Claude e GPT em minutos pelos menores preços, sem cortes. Cadastre-se e obtenha sua chave API.
Cadastro grátis