Limits and balance
The call counts toward the per-minute limit. See Rate limits.
Usage
GET /v1/usage returns balanceMicros (millionths of a dollar), costUsd for all your calls and requestCount of paid calls. It has no success or data wrapper.
GET /v1/usage/history takes these parameters. Read the window in data.from and data.to, the sum in data.totals and the rows in data.buckets (start, costUsd, requests).
The window spans at most 31 days for
hour and 366 for day and month, and from must be before to, or the call answers invalidRequest. start is the UTC start of the bucket. Buckets with no paid calls are left out.
GET /v1/team/credit-usage returns balanceUsd. Its plan and period fields are null. /historical returns periods, one per month, with startDate, endDate, totalCostUsd and costUsd. Add byApiKey=true to split each month by key, named in apiKey.
List calls
GET /v1/logs returns logs, newest first, 50 a page, with page, pageSize, total, totalPages and the endpoints you can filter by. Each row has id, requestId, createdAt, endpoint, costUsd, the key, the HTTP method and status.
Only billed calls are logged. A free call, an error and an empty result have no entry, and a billed zero data retention call does. Rows hold billing fields, not content. Logs are kept for 90 days.
GET /v1/logs/{id} takes the X-Request-ID of any answer, looks back days days (7 by default, up to 90) and returns data.costUsd. charges counts how often the call was charged: a crawl or batch charges once per page. An ID not billed in that time answers 404 notFound.
GET /v1/team/activity returns the same calls with a cursor. Each row has id, endpoint, api_version and created_at. Parameters: endpoint, limit (1 to 100, default 50) and cursor. Stop when has_more is false.
Jobs and model use
GET /v1/team/queue-status returns activeJobsInQueue, waitingJobsInQueue, jobsInQueue, maxConcurrency for your tier and mostRecentSuccess, the finish time of your last billed call.
GET /v1/team/token-usage has older field names ending in Tokens. The values count billed amounts, not model tokens. Read tokensUsed, byEndpoint and usedSince. /historical returns one row per month, split by key with byApiKey=true.
Save the X-Request-ID of every call you care about. It is on every answer and in every error body, and feedback takes it too. See Troubleshooting.