Separate input, cached input, and output. Use measured usage from a representative task when you have it.
FOR: Developers planning an API workloadKnow which product you are paying for
This calculator estimates model API usage, not a chat subscription or a third-party application plan. The official rate card quotes model prices per million tokens and separates input, cached input, and output.
We keep the rates and their source in one place so that the table and calculator use the same snapshot. The official pricing page remains the source of truth for billing.
Build a realistic estimate
Estimate the input and output tokens per request, then multiply by the expected number of requests. If only part of the input receives the cache-hit price, apply that rate to that part rather than discounting the whole request.
The official rate card distinguishes peak and off-peak periods. Choose the rate assumption that fits your planned usage instead of treating one displayed price as universal.
- Include instructions, conversation history, and tool results in input.
- Count retries and repeated agent turns.
- Keep the input and output estimates separate.
Compare the estimate with actual usage
Run a small representative batch in your own environment, record its usage, and revise the assumptions. Check both the average task and an unusually long task; a single short example can hide your real workload.
This calculator excludes Search and Fetch requests. The official guide lists each at $0.75 per 1,000 successful requests, with billing for server-side Search/Fetch calls through Harness, Claude Code, or Codex starting on 1 November 2026, Beijing time. Add those calls and any third-party charges when planning the full task budget.
Sources
Start with the original documents. Models and prices change; check the official pages before using them.
01Official DeepSeek API rate card02Tokens and token usage03Official Search and Fetch billing