本文へ移動

Per-request cost

Every answer carries billing: "free" (the research allowance) or "paid" (the prepaid balance). A paid answer carries OpenAI-shaped usage and chargedMicroUSD — the amount the ledger actually debited, from the provider receipt, never an estimate.

JSON
{"id": "...", "object": "chat.completion", "model": "qwen3.8-flash-next-whitehacker",
 "choices": [...],
 "billing": "paid",
 "usage": {"prompt_tokens": 120, "completion_tokens": 30, "total_tokens": 150},
 "chargedMicroUSD": 243,          // 120 × $0.90/M + 30 × $4.50/M
 "receiptId": "receipt-..."}

How free vs paid is decided

  1. With an AI balance, the request's maximum cost is reserved first (bytes as the token upper bound, max_tokens for output, at the rates, +25 %).
  2. Only a successful reservation runs paid, and it spends no free quota. No balance (402) means the free allowance, exactly as before. A free answer says why it was free in billingReason (usage-limit-exceeded / metering-off / billing-reconciliation-required / billing-unavailable), and so does the 429's message.
  3. If the balance is there but the ledger could not hold the reservation (a ledger write failure, for instance), the request is refused by name — 503 paid-admission-refused — never dropped onto the free allowance. "Out of balance" and "the ledger failed" never read as the same 429.
  4. After completion the receipt's token counts settle the hold and the rest is released; a failed job settles at zero and nothing is charged.
  5. Resending the identical request re-attaches to the same job and reservation (deterministic job id) — never charged twice.

An answer with settlement: "pending" was served but the ledger refused the settlement (reconciliation required); the hold stays until it is reconciled.