Billing
Only endpoints that intentionally differ from the standard API carry a chip; the chip links to the note that explains the difference.
You hold a prepaid balance in USD. Each settled request deducts its cost immediately; there is no invoice, no subscription and no seat count.
/api/dashboard/usage/api/dashboard/usage-stats/api/dashboard/balanceHow cost is computed
token_cost = ((input_tokens − cached_tokens) × selected_input_rate
+ cached_tokens × selected_cached_input_rate
+ output_tokens × selected_output_rate) / 1,000,000
cost = max(token_cost, minimum_charge)Token counts come from the upstream usage report, never from character estimation. Rates are the final retail rates of the actual selected offer. Cached input uses that offer's cache rate; cache-capable models with a 10% cache rate charge that fraction of the input rate. A per-request minimum applies to paid holds and settled charges. Read the current final USD amount fromminimum_charge in GET /api/dashboard/budgets. Your usage log records the settled charge. If billing metadata cannot be verified, the request is not charged.
Budgets and request price caps
Budgets limit input and output rates rather than total monthly spend. Set minimum percentages off official rates for all models, a family, or one model, or use exact model rate caps. Set an account default and optionally a stricter budget for an individual API key. Both apply: each effective rate cap is the lower saved cap. Request headers x-max-input-price and x-max-output-price use final retail USD per million tokens and can only tighten those limits. Raising a header cannot bypass a saved budget. See Budgets for scope selection, percentage calculations, and saving or deleting limits.
With no saved cap, marketplace requests remain bounded by the highest advertised catalog tier. These defaults refresh at least every 30 seconds; requests fail closed if the pricing snapshot is more than 120 seconds old. Static and free atmo/ models use their own pricing rules. Routing may wait up to 30 seconds for capacity. Generation time is additional, so this is not a hard overall request timeout. A zero input or output cap disables paid requests for that budget.
How a request reserves and settles
A paid request reserves a hold before the gateway forwards anything, then settles exact once the upstream usage report lands. The hold is estimated from prompt size plus the request's output cap — an uncapped request is first stamped at what the balance can afford, so the estimator observes the cap; when max_tokens is absent the hold assumes a 2048-output-token default — with a small per-request minimum; a hold the balance cannot cover answers 402 and nothing is forwarded. When usage settles, the hold reconciles against the exact charge — an over-reserved difference is refunded, an under-reserved extra is charged in full and the balance may go slightly negative. Debt cannot stack: a balance below the hold fails the atomic reserve, so nothing new starts until the user tops up. For non-streaming completions, the exact charge is returned in the X-Atmorouter-Cost header. Output settles exact against the usage frame.
Deposit vouchers
When deposit vouchers are enabled, enter a voucher on the Deposit page and select Apply before creating your invoice. A discount reduces the payment while preserving the deposit credit: a $10 deposit with a 20% discount costs $8 before fees and adds $10 to your balance. A $2 bonus on a qualifying $10 deposit costs $10 before fees and adds $12. Minimum deposits, dates, account limits, campaign limits and promotion budgets apply. Only one code can apply to an invoice. Payment method minimums still apply after discount; processing and network fees are separate. Fiat discounts round the payment up to a whole rupiah at the invoice exchange rate.
Turning voucher entry off prevents new voucher invoices; issued invoices retain their saved promotion. Only one unpaid voucher invoice is allowed per account across campaigns, and five voucher checkouts per 10 minutes limit repeated attempts. Apply is an estimate, not a reservation. Availability is checked again when the invoice is created. The Deposit page also confirms the payment and credit you applied: if those terms change, apply the code again before continuing. The invoice saves its promotion; later edits or expiry of the campaign do not remove it. Balance and promotional credits are added together only after verified payment. An underpaid voucher invoice does not receive promotional credits. Check the invoice before paying again, and contact support if a payment needs reconciliation. Never send funds to an expired checkout.
Custom deposit clients can include voucher_code and the unchanged preview as voucher_quote when creating a payment to require those exact terms. Without the optional preview, current terms apply at invoice creation. Submitted preview values never override the calculated payment or credit.
/api/dashboard/deposit/voucher/preview/api/dashboard/deposit/voucher/settings| Voucher response | Meaning | What to do |
|---|---|---|
| 403 · vouchers_disabled | Voucher entry is turned off. | Use an already issued invoice, or review the standard total before continuing without a voucher. |
| 409 · voucher_quote_changed | The current payment or promotional credit differs from the applied offer. | Apply the code again and review the new total. No payment was created for this rejected request. |
| 409 · voucher_pending | Another voucher invoice is awaiting payment or reconciliation. | Check payment history and resolve that invoice before creating another. |
| 429 · voucher_rate_limited | Five voucher checkout reservations were made in 10 minutes. | Wait for Retry-After. A repeat attempt is not proof that a payment failed. |
| 400 · voucher_unavailable | The offer does not meet its rules or a campaign limit has been reached. | Check the minimum deposit and voucher terms; do not pay an older invoice again. |
Deposits
/api/dashboard/deposit/info/api/dashboard/deposit/epusdt/create/api/dashboard/topup/qris/api/dashboard/deposits/api/dashboard/topups| Method | Notes |
|---|---|
| USDT / USDC | Pay with USDT or USDC via hosted checkout on Solana, BNB Chain, or Polygon. Each order gets its own amount and address and expires automatically. |
| QRIS | Pay in rupiah with any Indonesian bank or e-wallet app. Balance is credited automatically once the payment confirms, at the rate shown before you pay. |
Deposit lifecycle: create to reconcile
A deposit moves through six stages: create an order, watch its expiry, wait for the provider webhook to credit it, poll order status, read history, then reconcile spend. The two rails differ at exactly one stage — polling — so read the asymmetry row before building any status loop.
| Stage | What happens |
|---|---|
| 1. Create | Epusdt: POST /api/dashboard/deposit/epusdt/create, $1.00–$100,000. QRIS: POST /api/dashboard/topup/qris, floor from live settings (default 10,000 IDR) with a 2,000,000 IDR ceiling. An unconfigured rail answers 503 before field validation — read deposit/info enabled first. |
| 2. Expiry | Epusdt expiry is provider-driven. QRIS invoices expire 2 hours after creation and the timestamp is renewed when the provider invoice issues (expires_in 7200). Stale pending orders expire automatically every minute and expiry never settles anything; the Epusdt reconcile window covers the last 24 hours, newest 50. |
| 3. Confirmation and credit | A confirmed provider payment credits an order once. QRIS uses its signed webhook. Hosted crypto checkout can also reconcile payment through provider verification. Read the order status and balance to confirm payment. |
| 4. Poll — the asymmetry | GET /api/dashboard/deposit/epusdt/status?order_id= re-verifies a pending order against the provider inline when a trade id exists and the rail is configured — status 2 settles to credited, 3 marks expired. Polling Epusdt can settle money. GET /api/dashboard/topup/status?id= only reports the stored state — Sumopod exposes no status endpoint, expiry never settles, and only the signed webhook credits. A retired QRIS order answers retired. |
| 5. History | Per-rail histories: GET .../deposit/epusdt/list (newest 20) and GET .../topups (newest 50). GET .../deposits is the live combined history across both rails — every settle writes exactly one entry. It is not deprecated: never write “use topups/epusdt/list instead”. Current caveat: created_at can scan to an empty string and only the newest entry is returned, so treat timestamps as unreliable and the list as newest-first-truncated until the read path is fixed. |
| 6. Reconcile | Read the X-Atmorouter-Cost header per request, pull /api/dashboard/usage for the full log, and compare against official list prices in usage-stats (by_provider groups by catalogue family). |
Webhook idempotency and validation contract
Each confirmed order can credit the balance once. QRIS confirmation arrives through a signed webhook; hosted crypto checkout can also settle through provider reconciliation. Create first, pay second, and check status before considering another payment.
| Rule | What happens |
|---|---|
| Create, then pay | Epusdt reserves the order, calls the provider, then writes the provider invoice into it and answers 201; when provider creation fails the reserved order is marked failed and the call answers 502. The finalize write is error-checked too — if it fails the reserved order is marked failed and the call answers the same 502 with no order credentials, so a just-created order_id that answers 404, or any 5xx, means re-create and pay only the newest invoice or address. QRIS works the same way: a provider failure marks the order failed and answers 502, with order details saved before the 201 — and here the save is error-checked. |
| Exactly-once credit | Both rails claim the order with a single atomic status flip, so only the first delivery credits and a repeat can never double-credit. On a repeated delivery, check order status instead of paying again: Epusdt status re-verifies a pending order against the provider inline, while QRIS status only reports the stored state. |
| Ack shapes | A settleable paid Epusdt callback is acked plain-text ok. Anything non-payable is answered 200 JSON with no credit: ignored for unpaid status, rejected for an unknown network or a non-USDT/USDC token. A paid callback that carries no usable amount (actual_amount absent or zero) is a provider malfunction signal and settles as mismatch with no credit — only the amount-less status poller may credit on status alone. Deterministic rejects ack ok so the provider does not loop on the same payload; transient errors answer 500 so the provider retries. QRIS answers 200 JSON: completed settles, failed/expired events mark the invoice expired, and unmatchable bodies are ignored with a named reason. A non-ok 200 may be re-delivered by the provider — treat a repeat as a status check, not a second payment. |
| QRIS 2-hour expiry | QRIS invoices expire 2 hours after issue, and the timestamp is renewed when the provider invoice finalizes (expires_in 7200). Settle reads status only: once a stale pending order passes its expiry, a payment completed after expiry answers expired and credits nothing — the webhook alone cannot credit it, so it needs operator assistance. A missed webhook before expiry is recovered by re-sending it from the Sumopod dashboard; expiry only closes stale orders and never settles. |
| Live config surface | The live QRIS surface is SUMOPOD_API_KEY, with callbacks at /webhook/sumopod; Epusdt callbacks land at /webhook/epusdt. An unconfigured rail answers 503 before field checks; an unknown webhook path answers 404. |
| Pay the exact network and token | Pay on the exact network and token shown on the invoice: a network/token-mismatched paid callback is a terminal non-credit, acked ok so it is not retried. Chain naming normalizes bsc to binance on the wire at create and at settle. Switching chain or token at pay time risks a payment the gateway cannot match — open support with the new trade_id if you switched. |
| Invoice binds to its provider payment | Invoices opened after the payment-binding change are bound to their provider payment id, and a signed callback for a different payment is ignored instead of paired. The id is stored at create and looked up per callback. Earlier invoices predate the binding. No integrator action is needed. |
| Validation math and gates | QRIS credits only the exact invoiced rupiah inside a 2,000,000 IDR ceiling enforced at create and at the webhook. Epusdt orders span $1–$100,000, tolerate 1% underpayment, and credit min(paid, ordered). Both rails verify before settling — Epusdt HMAC over sorted params, Sumopod Svix with a 5-minute replay window and auth before parsing — and throttle callbacks at 30/min per IP with Retry-After. |
Why a request answers 402 (or 429)
| Signal | What it means |
|---|---|
| 402 empty balance | Balance is zero — top up to continue. |
| 402 input exceeds balance | The prompt alone costs more than the balance holds — top up to continue. |
| 402 output cap exceeds balance | The requested max_tokens asks for more output than the balance can afford; lower it or top up. |
| 402 zero output affordable | The balance cannot fund any output token — top up to continue. |
| 402 insufficient_balance | The available balance cannot cover the reservation. Add funds or reduce the request size. |
| 429 balance_temporarily_reserved | Other requests are temporarily reserving your balance. Wait for them to finish before retrying. |
| 503 price_limit_unavailable | No offer within your caps. The rejected request is not charged; review Budgets or retry later. |
| 502 upstream_unreachable | The gateway could not confirm the outcome of a forwarded request. Check Usage before resending and avoid automatic retries for an ambiguous outcome. |
| 503 model_route_cooling_down | Wait for Retry-After or error.retry_after_seconds. Three capacity refusals before output within one minute pause the affected model, protocol and effective price ceilings for 15 seconds. Customer-specific limits are isolated by account. One request tests recovery, with 30-second and then 60-second pauses if capacity remains unavailable. Changing a ceiling creates a separate capacity scope. Connection failures can pause the entire model route. |
| 503 pricing_unavailable | Fresh pricing cannot be verified. The rejected request is not charged; retry later. Adding funds does not resolve this error. |
| 429 thin-balance concurrency | Balance ≤ $0.05 admits 1 in-flight request, ≤ $0.25 admits 3, above that unbounded. Wait for in-flight requests or top up past $0.25 to lift the cap — this is the concurrency guard, not the minute-rate budget (see Rate limits). |
| 424 billing_settlement_pending | The generation may have completed while accounting is recovering. Do not automatically resend. Check Usage before submitting another request. |
| 502 billing_metadata_unavailable | Incomplete or invalid billing metadata. This response is not charged. |
| Closed stream | An interrupted response is charged only from valid reported usage and cost, within its price limits. A response without billable output or verifiable billing metadata is not charged. Check Usage before retrying. |
For an explicit capacity rejection before any output, wait at least the indicated retry delay, add a small random jitter, and allow at most three automatic retries. Without a delay hint, use waits of 2, 4, then 8 seconds plus jitter. Both API formats can receive capacity errors inside an HTTP 200 SSE stream. Inspect each error event and use error.retry_after_seconds there because HTTP headers have already been sent. If output has arrived or the outcome is uncertain, review Usage and any executed tools before sending a new request. Do not automatically increase price limits.
Free-model event
A request is free when it names an atmo/ model whose catalogue rates are both zero. Free traffic skips the balance hold entirely but still passes two gates: the account must hold at least $1.00 in lifetime completed deposits or the call answers 402, and per-account free tokens must remain or it answers 429. The free family defaults to the atmo/ prefix with a 100,000,000-token lifetime quota; promo edits take effect within 30 seconds. Billing on the free path settles to zero.
Operators may set a per-account quota: empty means the global 100M applies, 0 blocks free models for that account, and any larger value is that account's exact budget. Past the budget the gateway answers 429 with type rate_limit_exceeded and code free_tier_quota_exceeded on the OpenAI surface (rate_limit_error on Anthropic). Watch for the spelling in the JSON: it is free_tier_quota_exceeded (tier), not free-tier.
Reconciling spend
Read the X-Atmorouter-Cost response header per request, or pull /api/dashboard/usage for the full log. The Usage page also shows what the same traffic would have cost at official list prices, so you can see the saving directly.
/api/dashboard/deposit/epusdt/status/api/dashboard/deposit/epusdt/list/api/dashboard/topup/status/api/dashboard/affiliateOrder-status polling and history live on these endpoints:
GET /api/dashboard/deposit/epusdt/status — Poll one Epusdt order by order id.
GET /api/dashboard/deposit/epusdt/list — List past Epusdt orders.
GET /api/dashboard/topup/status — Poll one QRIS invoice by id.
GET /api/dashboard/topups — List past QRIS invoices.
GET /api/dashboard/deposits — Combined deposit history.
GET /api/dashboard/affiliate — Atmo-native referrals: summary, referrals, payouts, and ledger.
GET /api/dashboard/usage and GET /api/dashboard/usage-stats aggregate per account, with breakdowns by model and provider. Requests through the playground carry no key id by design.