GET /api/v1/billing
Returns a monthly usage summary for your account. Use this to track consumption, build invoices, and monitor quota.month query parameter is optional. It defaults to the current calendar month. Format: YYYY-MM.
Response shape
Fields
Top level
| Field | Type | Description |
|---|---|---|
month | string | The billing month returned, in YYYY-MM format |
client_id | string | Your account identifier |
summary | object | Aggregate course counts for the month |
quota_seconds | object | Authoritative seconds-bucket usage view |
breakdown_by_ref | array | Per-external_ref course and module counts |
note | string | Human-readable annotation; subject to change |
summary
| Field | Description |
|---|---|
courses_total | All courses created this month (excludes sandbox) |
courses_ready | Courses that reached ready status |
courses_partial | Courses stopped mid-generation due to quota exhaustion (partial_quota_exceeded) |
courses_error | Courses that ended in error |
distinct_external_refs | Count of unique external_ref values used this month. Use this to count billable clients or projects. |
total_modules | Sum of module_count across all courses this month |
quota_seconds
This is the authoritative usage view. Showpercent_consumed to clients as their usage gauge.
| Field | Type | Description |
|---|---|---|
quota_seconds | integer | Total seconds allocated to your account this billing period |
consumed_seconds | integer | Seconds used so far this month |
remaining_seconds | integer | quota_seconds - consumed_seconds, floored at 0 |
percent_consumed | integer | Usage as a percentage (0-100). This is the figure to surface to clients. |
is_unlimited | boolean | true if quota_seconds is 0 or unset (unlimited plan) |
metered_billing_enabled | boolean | Whether quota enforcement is active on your account. When true, launches are rejected with 429 quota_exceeded once remaining_seconds reaches 0. When false, generation is not blocked on quota. |
metered_billing_enabled is true and the bucket is exhausted, new launches are rejected with 429 quota_exceeded.
breakdown_by_ref
One entry per distinctexternal_ref value used this month. Useful for building per-client or per-project usage summaries.
| Field | Description |
|---|---|
external_ref | The caller-supplied reference string |
courses | Total courses created under this ref this month |
courses_ready | Courses that reached ready |
modules | Total modules across all courses under this ref |
Usage monitoring pattern
Poll/billing on a schedule to track quota burn and alert before exhaustion:
percent_consumed is clamped at 100 even if consumed_seconds slightly exceeds quota_seconds due to in-flight jobs completing after the soft cap.