Billing

Get credit usage summary

GET
/billing/credits

Returns the total number of credits used between start_date and end_date, with a breakdown by job type and time bucket (day, week, or month).

Authorization

token_auth
headerAuthorizationBearer <token>

Token-based authentication using access tokens.

Query Parameters

start_date?Start Date

Starting datetime (UTC) in ISO 8601 format.

end_date?End Date

Ending datetime (UTC) in ISO 8601 format.

resolution?Resolution

Time resolution for credit aggregation.

Default"day"
Value in"day""week""month"

Response Body

Successful Response

application/json
  1. response
total_credits*Total Credits

Total credits used across all jobs in the period.

summary*array<>

Breakdown of credits used by job type.

curl -X GET "https://example.com/billing/credits"
{  "total_credits": 0,  "summary": [    {      "period_start": "string",      "period_end": "string",      "job_type": "string",      "total_credits": 0,      "job_count": 0,      "image_count": 0    }  ]}