Authentication
string
required
Use the same API Key you use to call models, with Bearer Token authentication. Get your key on the API Key management page.
Endpoints
cost_credits and credits are in credits, equal to USD × 10.
Look up a single record by request ID
string
required
- Synchronous calls: the value of the
X-Oneapi-Request-Idresponse header - Asynchronous tasks: the task ID returned on submission
Logs are written asynchronously and usually appear within a few seconds after the request ends. If you get
404 log_not_found, retry later. Asynchronous tasks must be looked up by task ID, and only have a record once the task has completed or failed.data is an array; the same ID may have both a consume record and an error record. Main fields:
cost_usd is the final settled amount: error records are always 0, and refunds for failures are completed before the record is written. Summing records whose type is consume gives the total charged for your calls.
Sync Request Logs
integer
required
Start time, Unix timestamp in seconds.
integer
End time, Unix timestamp in seconds. Defaults to now. Both ends are inclusive, and the range must not exceed 31 days.
string
default:"all"
Record type:
all, consume, or error.string
Filter by model name.
integer
Only return records of the given API Key. Copy the ID from the “API Keys” list in the console (shown below the key name); the ID stays the same after the key is rotated.
integer
default:"100"
Page size,
1–1000.string
Pagination cursor. Pass back the previous page’s
next_cursor unchanged, and keep all other parameters the same while paging.has_more tells you whether there is another page, next_cursor is the cursor for the next page, and watermark is the server time minus 300 seconds.
Get account pricing
string
required
Model name; aliases are supported.
string
Resolution or tier; must be a tier the model supports.
string
Image size.
string
Quality tier.
integer
Duration in seconds,
1–3600, for per-second models.integer
Number of outputs,
1–100.duration is omitted.
Main response fields:
Up to
60 requests per minute per API Key.