Edit content/en/quota.md on GitHub ↗

Quota and cost

The rule

Every user starts with 1 CNY of platform-funded model usage (INITIAL_QUOTA_CNY). When it is gone, the platform stops paying and tells the user to configure their own OpenAI-compatible model service. Their jobs then run on their key, with no platform metering.

Units

Cost source

  1. The x-litellm-response-cost response header (USD), when present. This is the gateway's actual charge and includes retries and discounts.
  2. Otherwise usage.total_tokens (or prompt + completion) × PLATFORM_LLM_PRICE_PER_TOKEN (default 0.0000002 USD/token).

For streaming requests Fledge sets stream_options.include_usage = true and parses each SSE data: line, keeping the last usage object. A request already in flight is allowed to finish; the next request sees the updated balance.

Enforcement

The 402 body includes FLEDGE_QUOTA_EXHAUSTED, the current quota and a settings link.

Repository and per-job budgets

A maintainer can set two optional caps per repository:

Budgets apply to platform-funded usage. A user running on their own model key is not metered by the platform.