本文へ移動
メイン ドキュメント
ドキュメント

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.
  3. 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.
  4. 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.