402 insufficient_credits, or when you need a receipt.
Open it at console.opentype.dev/billing. Reading the page needs billing_read, which every role holds. Adding funds, changing auto-recharge and opening cards and receipts need billing_write, which owners, admins and the billing role hold.
How credit works
OpenType is prepaid, in US dollars. Every run is charged against your organization’s balance.- A new account’s organization gets $5 of free credit once its email address is verified, one grant per email address. See Create an account.
- While a run is in flight it holds up to its ceiling of $0.02. When it settles, the hold is replaced by what it actually cost, which for a decision run is usually a small fraction of a cent.
- A run can start only while the balance covers that hold. Otherwise
POST /v1/runsrefuses it with402 insufficient_credits, and nothing is charged.
Balance
The Balance panel shows the balance in dollars, for example$24.98, and its meta says whether a card is saved: card on file or no card on file.
The balance is credits, less settled spend, less what in-flight runs still hold. Two notes can appear under it:
- New runs are refused with 402 until funds are added. when the balance is zero or below.
- Below the auto-recharge threshold; a recharge is due. when auto-recharge is on and the balance is under its threshold.
Add funds
1
Enter an amount
In the Balance panel, type an amount in dollars. It starts at
20. Any amount from 1,000 in whole cents is accepted.2
Choose Add funds
The console sends you to a secure Stripe checkout page for that amount. The line item reads OpenType credits.
3
Pay on Stripe
Pay with a card. Paying also saves the card, which auto-recharge can then use. If you cancel, nothing is charged.
4
Come back to Billing
Stripe returns you to the Billing page either way. The credit is added once Stripe confirms the payment, not before; reload if the balance has not moved yet. A purchase row, Credit purchase, appears in Transactions.
Cards, receipts and invoices
The button at the foot of the Balance panel opens the Stripe billing portal for your organization. It reads Cards, receipts and invoices when a card is saved, and Add a payment method when none is. In the portal you can add or replace the saved card and download receipts and invoices for your purchases. Closing the portal returns you to the Billing page.Auto-recharge
Auto-recharge buys credit for you when the balance runs low, so production traffic is not refused with402.
- In the Auto-recharge panel, tick Recharge the card on file when the balance runs low.
- Set When below, $: the balance under which a recharge is made. It starts at
10. - Set Buy, $: how much to buy each time. It starts at
50. - Choose Save. The page confirms with Auto-recharge saved., and the panel’s meta reads
on.
- The balance is checked after each run is admitted and after each
402refusal. When it is below When below, the card is charged Buy. - At most one recharge is made per organization per hour. A burst of traffic that spends more than Buy within an hour can still reach
402, so size Buy for an hour of your peak spend. - The credit lands when the payment succeeds, as a purchase row reading Auto-recharge.
Transactions
Transactions lists the last 50 movements of credit, newest first. Its meta reads, for example,newest first · last 12.
Usage is booked as one row per day, not one per run. For the cost of a single run, use the request log on Usage. Before anything has happened, the list reads No transaction yet: Purchases, grants and settled usage appear here.
Billing is not switched on here
On a deployment with no payment processor connected, the page shows a single panel instead:Billing is not switched on here No payment processor is connected to this deployment, so there is no balance, card or invoice to show, and none is invented here.Its code is
billing_not_configured and its status 503. Nothing on your side will fix it; runs are not refused for credit there. If the balance could not be read for another reason, the panel reads The billing account could not be read, with the code and message, and the balance is withheld rather than shown as zero.
What goes wrong
Refusals appear at the top of the page as[!] followed by the code and a sentence.
Do the same from code
Every control on this page is one API route. Reading needsbilling_read; the rest needs billing_write, which a key can hold only if it was created through the API by someone whose role has it.
Amounts are integer micro-USD: 5 to $1,000 is
5000000 to 1000000000.
GET /v1/billing answers with everything the page shows:
200 with {"checkout_url": "…"}; the credit arrives only after payment, not in that response.
Related
- Credits and billing - holds, settlement, and how a run’s cost reaches the balance.
- Auto-recharge - choose a threshold and amount, and what happens when a charge fails.
- Handling insufficient credits - what to do in code when a run gets
402. - Usage - the cost of each run behind the daily usage rows.
- Models and pricing - what Neon 1.1 costs per token.