Check your balance
The balance is shared by every API key in the workspace.balance is a decimal string with four fractional digits, so you can parse it without floating-point rounding. Use your language’s decimal type for comparisons and arithmetic.
Track daily costs
GET /v2/billing/costs returns one cost bucket per day, plus a total for the range. Costs cover every API key in the project.
Range parameters
Both bounds are inclusive. A range that omits the time zone, ends before it starts, or spans more than 180 days returns
400 with error code invalid_parameter.
How buckets work
- Buckets use UTC calendar dates, in ascending order.
- Days with no spend are included with a cost of
0. - The end date gets its own bucket.
- The first and last bucket can each cover a partial day when your range starts or ends mid-day.
Top up credits
Add credits to your account on the billing page. Click Top up balance to make a one-time purchase.Auto top-up
On the same billing page, you can enable auto top-up. When your balance drops below a threshold, credits are added automatically.Cost per generation
Every completed generation returns ausage object with the cost of that generation. Use it to attribute spend as you go instead of reconciling daily totals. See Media responses.
For the rates behind those costs, see the pricing field on each model in Models.
API billing vs consumer plans
API credits are separate from the consumer plans listed at getimg.ai/pricing.- Credits purchased for the API do not transfer to consumer plans, and vice versa.
- A consumer subscription is not required to use the API.
- The two systems use independent balances.