Credits
The following endpoints can be used to see your current credit balance with Topaz API and how your credits have been consumed over time. If you would like to add more credits to your account, please visit https://topazlabs.com/my-account/subscriptions/
Allows you to view your current API credit balance.
Authentication via the Topaz generated key in the X-API-Key header.
Credit balance
The number of credits available to you.
100The number of credits reserved by you (if applicable).
10The total number of credits in your account (available credits + reserved credits).
110GET /account/v1/credits/balance HTTP/1.1
Host: api.topazlabs.com
X-API-Key: YOUR_API_KEY
Accept: */*
Credit balance
{
"available_credits": 100,
"reserved_credits": 10,
"total_credits": 110
}Returns time-bucketed API credit consumption for the account that owns the API key. This endpoint reports historical usage over time; for your current balance use GET /credits/balance instead.
Scope. Results are always scoped to the account that owns the key — there is no parameter to request another account's usage. For a pro-mode (pooled) key, usage is reported against the credit pool the key draws from, so every member of a pool sees the pool's consumption.
Time range. A time range is required: send either period, or both start_date and end_date. If you send both forms, the explicit date range wins. granularity is only honored with start_date/end_date; with period, 1d is always hourly and 7d / 30d are always daily.
period
string | null
Echo of the period you sent; null if you did not send one.
granularity
string
Bucket width the usage entries represent.
start_date
string | null
Resolved start of the window. null when period=1d.
end_date
string | null
Resolved end of the window. null when period=1d.
group_by
string | null
Echo of the group_by you sent.
total_credits
number
Credits consumed over the whole window. May be fractional.
total_requests
number
Requests over the whole window.
usage
array
{period_start, credits} buckets in ascending time order.
period_start is the bucket's UTC start; there is no period_end, so derive the width from granularity. Summing usage[].credits should equal total_credits.
Grouping. With group_by, each bucket gains a groups array of {key, credits}. Groups that contributed nothing to a bucket are omitted, so the array length varies between buckets. Rows whose grouping field is empty are collected under the key "Unknown".
Caveats
usageis sparse. Buckets with no activity are omitted rather than returned as zero, so consecutive entries are not necessarily one bucket apart.period=1dreturns 48 hours, not 24. It is also the one form that leavesstart_dateandend_dateasnullin the response, so read theperiod_startvalues to learn which hours you received.weekand3daybuckets are not calendar-aligned. They are fixed-width windows anchored to the first bucket that has data in the result, so the same date can land in a differently-labelled bucket depending on the range you request.monthbuckets snap to calendar-month starts;houranddayfollow UTC boundaries.granularityandgroup_byare not validated. An unrecognizedgranularityis accepted, bucketed as if it wereday, and echoed back verbatim. An unrecognizedgroup_byputs every bucket under"Unknown". Stick to the documented values.No CORS headers. Browser JavaScript on another origin will be blocked regardless of the key. Call this endpoint server-side.
Not cacheable. Responses are returned with
Cache-Control: private, no-store.Errors carry only
message. Unlike the Video API, errors from this endpoint do not include anerrorCodefield, so do not branch on one.
Authentication via the Topaz generated key in the X-API-Key header.
Relative window ending now. 1d returns 48 hours, not 24 (see caveats).
{"value":"7d"}Possible values: Inclusive start of the window (UTC). Requires end_date.
{"value":"2026-09-01"}Inclusive end of the window (UTC). Must be on or after start_date.
{"value":"2026-09-30"}Bucket width. Ignored when period is used.
dayPossible values: Restrict usage to the given model. Repeat the parameter to filter on several models.
{"value":["gigapixel","proteus"]}Restrict usage to requests made with a single API key.
Adds a per-bucket groups breakdown by the given field.
Credit usage for the requested window
The request did not specify a usable time range, the date range was malformed or inverted, or the upstream usage service returned an unusable payload.
The X-API-Key header is missing or the key was rejected. Both cases produce the identical response,
so a 401 does not tell you which of the two happened.
Unhandled server fault.
The upstream usage service failed. Its HTTP status (4xx or 5xx) is passed through unchanged.
GET /account/v1/credit-usage HTTP/1.1
Host: api.topazlabs.com
X-API-Key: YOUR_API_KEY
Accept: */*
{
"period": "7d",
"granularity": "day",
"start_date": "2026-09-18",
"end_date": "2026-09-24",
"group_by": null,
"total_credits": 1284.5,
"total_requests": 96,
"usage": [
{
"period_start": "2026-09-18T00:00:00.000Z",
"credits": 412
},
{
"period_start": "2026-09-19T00:00:00.000Z",
"credits": 530.5
},
{
"period_start": "2026-09-21T00:00:00.000Z",
"credits": 342
}
]
}Last updated
