TOKEN COST LAB

LLM API Token Cost Calculator

Estimate token, batch-task and billed-retry costs, then compare pay-as-you-go with monthly plans for your active days. No account or API key needed.

Enter prices from the current model catalog See retry costs separately Calculated locally in your browser

Want to check Link pricing? See the dated price comparison for a specific model group, then estimate your own workload. No signup required; one example is not a site-wide discount.

01 · Inputs

Enter model prices and expected usage

Illustrative values, not price offers. Loading replaces the token inputs below, not monthly-plan inputs.

Usage basis

Prices, token counts and task counts stay in your browser.

02 · Cost results

Ready to calculate

Enter current prices and usage to see base costs, billed retry costs and the estimated total.

View cost control methods

Pay-as-you-go vs monthly plan: compare active days

Compare cash costs in CNY for the same workload. Estimate pay-as-you-go charges and plan-group Credit consumption separately. Credit is a platform usage unit, not USD or a fixed token count.

This estimate assumes equal workloads on active days within a 30-day plan and no carryover of unused daily allowances. For uneven usage, calculate each day's overage separately; idle-day allowances cannot offset peak days in this estimate.

Enter current plan details and workload estimates. Placeholders are illustrative, not price offers.

This compares costs only, not model quality, success rate or availability. The full plan payment is included even with no usage. Cancellation and refunds depend on the purchase terms.

Check Link plan and billing rules

How do API usage fields map to the cost calculator?

Check the response protocol, then enter input and output tokens separately. Do not put total_tokens in both fields or estimate billed usage from visible answer length. This mapping does not establish that every Link model returns complete usage.

Response protocolInput-token fieldOutput-token field
Chat Completionsusage.prompt_tokensusage.completion_tokens
Responses APIusage.input_tokensusage.output_tokens

Output totals may include hidden reasoning or formatting tokens; do not add included details again. If usage is missing, check usage logs instead of entering zero for unknown values. Choose Per-task usage to project from one task, or Aggregated usage for totals across requests without multiplying by task count again.

Combine only billing categories for the same model and effective rates. Retries already included in the totals are not added again; this does not mean no retries occurred. Aggregated mode does not infer actual request counts or per-task costs. Calculate different rates and cache categories separately, then sum them.

How do you convert per-thousand to per-million token rates?

All price fields use rates per million tokens. Multiply a per-thousand rate by 1000: for example, 0.0025 per thousand equals 2.5 per million in the same currency. This is a unit-conversion example, not a quote. Use one currency for input and output, and do not reapply a group multiplier already included in the effective rate.

Can cache reads and writes use the ordinary input price?

Do not assume so. This tool does not automatically separate cache rates. Check whether the protocol includes cache reads and writes in its input total, then price non-overlapping ordinary input, cache reads, cache writes and output separately. Split writes by retention period when necessary. Sum the categories and confirm unknown fields or rates with your provider first.

For example, if 3000 total input tokens include 2000 cache reads and no cache writes, ordinary input is 1000. Do not charge all 3000 at the ordinary rate and then add 2000 cached tokens. Use this split only after confirming the field relationship; do not apply OpenAI field semantics to Anthropic or another gateway without checking.

Field references: OpenAI Chat Completions usage · OpenAI token-counting guide · OpenAI cache-usage guide. Official protocol documentation does not guarantee Link pricing or compatibility.

Review the reproducible offline cost formula and input fields

GPT and Claude API cost example: 1,000 tasks

These are illustrative values, not AIFast Link or model-vendor prices: $2.50 per million input tokens, $10 per million output tokens, 3,000 input and 800 output tokens per request, and 1,000 tasks. Assume 10% additional billed retries with the same token usage.

(3000 × 2.5 + 800 × 10) / 1000000 = $0.0155
$0.0155 × 1000 = $15.50
$15.50 × 10% = $1.55
$15.50 + $1.55 = $17.05

The base cost is $15.50, retries add $1.55, and the total is $17.05. Exclude failed requests that were not billed. Calculate retries separately when their token usage differs. Separate cache, tool and image charges are outside this formula.

To reproduce the calculation locally, see Link GitHub examples and tests. The offline version uses Node.js 22 or newer, has no third-party dependencies and needs no network or API key. Included inputs are illustrative, not current offers.

Monthly plans reset daily, so the advertised monthly total cannot replace a pay-as-you-go estimate. Compare actual usage days with the Link pay-as-you-go and monthly plan rules.

Compute boundaries

Compare complete task costs

A lower token price does not always mean a lower task cost. Retries, long contexts, tool loops and manual rework also matter.

  1. 01

    Use measured token usage

    Sample the response usage fields and billing records instead of estimating from prompt character counts.

  2. 02

    Include billed retries

    Count only additional requests that were actually billed. Check usage logs and billing records to determine whether failed requests incurred charges.

  3. 03

    Compare by complete tasks

    At the same time, record the completion rate, delay, rework time and token cost, and then decide the model and routing.

API cost calculator FAQ

Results are estimates based on input conditions and do not replace console billing and production logs.

Why enter prices manually?

Prices, billing units, cache charges and discounts change. Entering current prices keeps your estimate traceable and avoids relying on outdated rates.

How should I calculate the billed retry percentage?

Divide additional retries that were actually billed, as shown in billing or usage logs, by planned tasks. For 100 planned tasks and 8 retries of which only 3 were billed, enter 3%, not 8%. This tool assumes each retry has the same input and output token counts and unit prices as one planned task; calculate differing usage or prices separately. Enter 0 when no retries were billed. With no data, 0 is only a temporary assumption, not evidence of zero retry cost.

Is the Token cost equal to the complete business cost?

No. Total costs may also include images, video, retrieval, caching, tools, networking, manual rework and recovery. This calculator estimates only the text tokens and billed retries you enter.

Will the calculation results be uploaded?

No. All input and calculations are completed in the current browser, and model prices, tokens, or task quantities will not be submitted.

Is a monthly plan always cheaper than pay-as-you-go?

No. Pay-as-you-go costs depend on billable usage, including billed retries, while the full plan fee applies even with little or no use. Calculate overages each day; unused daily allowance cannot cover another day's peak. Compare totals only after confirming model eligibility and that daily allowances or wallet fallback cover the same workload.

Check model prices and availability on the Live price page and in the console. Continue with API cost estimation and usage controlandModel API comparison test template.