Skip to content

API billing multipliers: how model ratio, completion ratio, group ratio and top-up rate work

In New API (v1.0.0-rc.52, checked 2026-11-30) and compatible relays, a model ratio of 1 equals $0.002 per 1K input tokens ($2 per 1M input tokens), with 1 USD equal to 500,000 quota by default. A request's charge weights each kind of token (completion ratio for output, cache ratios for cached tokens), multiplies the sum by the model ratio and the group ratio, and what you pay in cash then depends on the site's top-up rate (local cash paid per $1 credit). Below are the exact formulas, a fictional Model A table and worked example, six checks for 0.x claims, and Router One's posted billing.

1. Core formulas and definitions (New API v1.0.0-rc.52)

Relays built on One API or New API meter requests in internal quota points. Per New API v1.0.0-rc.52 docs and Go source (checked 2026-11-30), five pieces set the charge:

Quota unit and model ratio baseline

QuotaPerUnit defaults to 500,000 (common/constants.go; the operator can change it), so $1 of credit equals 500,000 quota unless the site changed it. Model ratio 1 equals $0.002 per 1K input tokens, or $2 per 1M (setting/ratio_setting/model_ratio.go). At group ratio 1: input_$/1M = model_ratio × $2, and model_ratio = input_$/1M ÷ 2.

Pay-as-you-go token formula and completion ratio

Completion ratio equals output_price ÷ input_price. In classic per-token mode (service/text_quota.go), Quota = (input_tokens + output_tokens × completion_ratio) × model_ratio × group_ratio, and USD credit deducted is Quota ÷ 500,000. Output price per 1M tokens equals model_ratio × completion_ratio × $2 × group_ratio.

Prompt cache read and cache write ratios

Per setting/ratio_setting/cache_ratio.go and service/text_quota.go, a model with no entry in the cache-ratio tables falls back to 1.0 for cached reads (the full input rate) and 1.25 for cache writes; many models ship with built-in entries, and 1-hour and 12-hour writes cost 1.6x and 2x the write ratio. For OpenAI-format usage (prompt_tokens includes cached tokens), New API subtracts cached tokens before weighting them; for Anthropic-format usage, it adds separately reported cache counts directly.

Group ratio, per-call pricing and unset-model fallback

Each billing group has a group ratio (default 1), and a user-group-to-billing-group override takes priority when set (setting/ratio_setting/group_ratio.go). Fixed per-call models charge Quota = fixed_price_USD × group_ratio × 500,000. A model with no price, ratio or expression configured returns an error in standard billing mode; self-use / accept-unset-ratio mode falls back to model ratio 37.5 ($75 per 1M input tokens at group ratio 1).

Tiered billing expressions (newer New API mode)

New API v1.0.0-rc.52 deprecates legacy Per Token / Per Request fields in favor of Billing Expressions (guide/feature-guide/admin/billing-expression). Coefficients are written directly in USD per 1M tokens (p input, c output, cr cache read, cc cache write), len measures full input length including cached tokens, so a cache hit does not move a request into a lower long-context tier (len <= threshold ? tier(...) : tier(...)), and fixed(amount) handles per-call fees. Group ratio still applies: Quota = expression_result ÷ 1,000,000 × 500,000 × group_ratio.

2. Ratio-to-dollar conversion table and worked example

New API ratio arithmetic at group_ratio = 1 ($1 = 500,000 quota), not the price of any model:

worked-example-model-a.txt
Fictional Model A (all values hypothetical):
  model_ratio = 1.5  -> base input  = $3.00 / 1M
  completion  = 4    -> base output = $12.00 / 1M
  cache_ratio = 0.1  -> cache read  = $0.30 / 1M
  group_ratio = 0.8  -> effective   = 80% of base

Request: 10,000 prompt (4,000 uncached + 6,000 cached), 2,000 output
  Weighted input:  4,000 * 1 + 6,000 * 0.1 = 4,600
  Weighted output: 2,000 * 4               = 8,000
  Quota:           (4,600 + 8,000) * 1.5 * 0.8 = 15,120
  USD credit:      15,120 / 500,000 = $0.03024

Check via effective rates ($2.40 / $0.24 / $9.60 per 1M):
  $0.00960 + $0.00144 + $0.01920 = $0.03024

With the fallback cache_ratio = 1.0 instead of 0.1:
  (10,000 + 8,000) * 1.5 * 0.8 / 500,000 = $0.04320 (+42.9%)
2. Ratio-to-dollar conversion table and worked example
Model ratioInput ($ / 1M tokens)Output at 3× completion ratioOutput at 5× completion ratio
0.15$0.30$0.90$1.50
0.5$1.00$3.00$5.00
1.0$2.00$6.00$10.00
1.5$3.00$9.00$15.00
2.5$5.00$15.00$25.00
5.0$10.00$30.00$50.00

3. How the top-up rate multiplies into your real cash price

Relay credit is displayed in USD, but out-of-pocket spend depends on the top-up rate (cash paid per $1 of credit). Per New API (controller/topup.go, checked 2026-11-30), payable cash equals top_up_USD × unit_price × user_group_top_up_ratio × amount_discount. Group ratio and top-up rate multiply directly:

  • Real input cost (local currency / 1M) = model_ratio × 2 × group_ratio × (cash_paid_per_$1_credit).
  • Real output cost (local currency / 1M) = model_ratio × completion_ratio × 2 × group_ratio × (cash_paid_per_$1_credit).
  • Fictional Model A (model_ratio = 1.5, completion_ratio = 4): Site X sells $1 credit for 2.00 CNY with group_ratio = 2.0, yielding 12.00 CNY / 1M input (48.00 CNY / 1M output). Site Y sells $1 credit for 7.00 CNY with group_ratio = 0.5, yielding 10.50 CNY / 1M input (42.00 CNY / 1M output) — lower despite the higher top-up rate.
  • On the $0.03024 Model A call above: a 3.50 CNY / $1 top-up rate costs 0.10584 CNY cash, while 7.20 CNY / $1 costs 0.21773 CNY.
  • Always divide actual cash paid (including checkout fees) by usable USD credit before multiplying by effective USD per 1M tokens.

4. Six questions to ask whenever you see a 0.x multiplier

A 0.3× or 0.5× label says little without its base. Check six things before moving real traffic:

  • 1. What is 1× anchored to? Confirm model_ratio × $2 against the baseline input rate so a doubled base ratio isn't masked by a 0.5× group discount.
  • 2. What is the completion ratio? A high completion ratio can offset a low input ratio on jobs that write a lot of output.
  • 3. How are prompt cache reads and writes billed? In New API a model without its own cache-ratio entry falls back to 1.0 for reads (the full input rate) and 1.25 for writes.
  • 4. Which group ratio applies to you? A user-group-to-billing-group override changes what each request costs; a separate top-up group ratio can change what you pay per $1 of credit.
  • 5. What is the real top-up rate and balance expiry? Include payment fees in cash per $1 credit and verify whether credits expire.
  • 6. Do long-context requests jump tiers? Under billing expressions or whole-request tiers, exceeding an input threshold can raise the rate for the entire request, including output.

5. How Router One displays and settles API billing

Router One posts each model's input and output token rates directly in USD per 1M tokens on /models, with any FX rate and payment-channel fee shown at checkout before you pay. Dashboard → Logs records each request the gateway forwards to a model with its model, tokens, wallet charge or plan quota used, latency and status, plus the discount source, plan multiplier and applied multiplier where they apply; a streamed request that failed before any output may have no record. See /pricing-methodology for full billing rules and /llm-cost-calculator to estimate monthly spend from live posted rates.

FAQ

What does a billing multiplier mean on an API relay?

On New API (v1.0.0-rc.52) and One API (v0.6.10) relays (both checked 2026-11-30), multipliers convert tokens into internal quota (500,000 quota = $1 credit by default): model, completion and group ratios on both, plus cache ratios on New API. Model ratio 1 equals $0.002 per 1K input tokens ($2 per 1M) at group ratio 1.

How do I convert a New API model ratio to dollars per 1M tokens?

Use input_$/1M = model_ratio × $2 × group_ratio and output_$/1M = model_ratio × completion_ratio × $2 × group_ratio.

How do I calculate the true cost when a site also has a custom top-up rate?

Multiply effective USD per 1M tokens by actual cash paid per $1 credit (including checkout fees). A low top-up rate times a high group ratio can cost more than a higher top-up rate times a low group ratio.

Does New API still use model ratio and completion ratio in v1.0.0-rc.52?

Yes for legacy compatibility, though v1.0.0-rc.52 (checked 2026-11-30) deprecates Per Token / Per Request fields in favor of Billing Expressions written in USD per 1M tokens. Group ratio still multiplies expression results.

Why did my prompt-cached request cost more than expected on a relay?

Per New API setting/ratio_setting/cache_ratio.go (checked 2026-11-30), a model with no cache-ratio entry falls back to 1.0 for cache reads and 1.25 for cache creation, so its cached reads bill at the full input rate; many models ship with lower built-in values, and the operator can change any of them.

What happens if an operator forgets to set a model ratio in New API?

Per New API v1.0.0-rc.52 (relay/helper/price.go, checked 2026-11-30), standard billing returns an error when the model also has no fixed price and no billing expression; self-use / accept-unset-ratio mode falls back to model ratio 37.5 ($75 per 1M input tokens at group ratio 1).

Does Router One use hidden multipliers or separate top-up ratios?

Router One posts per-1M-token USD rates directly on /models and shows checkout FX/channel fees before payment. Dashboard → Logs records each request the gateway forwards to a model with its wallet charge or plan quota used, plus the discount source, plan multiplier and applied multiplier where they apply; see /pricing-methodology.