Skip to main content
The API uses a prepaid credit balance. Each generation draws from that balance, and you can read both the balance and your daily spend from the API.

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.
A workspace with no billing set up returns a zero balance.

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.
Costs are reported as numbers in USD, unlike the balance.
Cost data is usage telemetry and can lag recent charges. Treat it as a spend report, not as the authoritative billing ledger. Reconcile against the billing page.

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 a usage 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.

Need help with an older setup

If you still have questions about an older (v1) setup, contact api@getimg.ai.