Documentation

Billing and limits

Reservations, settlement, spend caps, and rate limits.

How a request is billed

  1. Reserve. Before the model is called, Friday holds the worst-case cost. For chat that is the input estimated at one token per 2 characters, plus max_tokens. If max_tokens is omitted it defaults to the model's maximum output tokens. Images, speech and transcription reserve their unit price times the units.
  2. Settle. When the call finishes, you are charged the actual cost from the usage the provider reports, and the rest of the hold is released.
  3. Failures. Failed upstream calls are not charged and the hold is released.

If available balance is below the reservation you get 402 insufficient_balance; lowering max_tokens lowers the reservation. Promotional credit is spent before paid balance.

Versioned prices

Prices are versioned. Each request pins the price version in effect when it starts and reports it in x-friday-price-version; later price changes never change what an earlier request cost. Costs are whole paise, rounded up per dimension.

Limits

LimitBehavior
Organization monthly capHard cap. Spend this month plus in-flight holds plus the new reservation must fit, else 402 org_budget_exceeded.
Project monthly capSame, per project: 402 project_budget_exceeded.
Key spend capLifetime hard cap for the key: 402 key_budget_exceeded.
Requests per minutePer key and per organization. Returns 429 rate_limited with Retry-After. Best-effort per server instance, so with several instances the effective limit can be higher.
Organization concurrencyToo many requests in progress returns 429 concurrency_limit.

Spend and balance checks are enforced in the database and are strict. Alert thresholds are soft and only create notifications.