Billing and Usage API

The Billing and Usage API manages subscriptions, payment details, credits, spending limits, and usage reports.

Subscriptions and credits

A subscription determines plan features and resource limits. Credits pay for supported consumption and can come from a monthly allocation or purchased balance.

Payment methods, invoices, checkout sessions, and credit transactions record different parts of the billing lifecycle. A usage total is not an invoice or a payment record.

Budgets

A budget caps monthly AI spending for a project, person, API key, or combination of these fields. A request matches a budget when it matches every configured scope field.

Creating or changing a budget does not reset usage already recorded that month. Multiple budgets can apply to a request. Account credit and other spending checks still apply.

Usage and attribution

Usage reports group consumption by the dimensions supported by the operation, such as project, member, model, or API key. Some project-scoped endpoints return account-wide totals. Check the reporting scope in the reference.

Unattributed usage means that caller information was not recorded. Missing deployment metadata does not establish where inference ran.

Quotas and reporting scope

A quota limits resource capacity. Credits provide a balance for supported consumption. A budget limits AI spending for its scope. Available credits do not mean that a quota has remaining capacity.

A representative task run can help estimate recurring costs. Compare the same resource types and reporting periods. Check whether totals cover one project or the whole account.

API key and model limits

Per-key inference limits can narrow allowed models and request rates within project policy. The AI Gateway API describes policy and enforcement behavior. The Identity and Access API manages the keys themselves.

Get started

Check usage and limits to read account consumption and quotas.

API references