Base URL
Authentication
Send a key as a bearer token on every request:GET /creditsandGET /activityneed a management key (sk-prl-mgmt-). Org admins create them on the Management Keys page; the full key is shown once. A management key reads data for its whole organization and cannot call models.GET /keytakes any API key, inference keys (sk-prl-infapi-) included, and describes the key that calls it. An inference key on any other endpoint gets a403.- A revoked, deleted, or expired key stops working right away and gets a
401.
Endpoints
Example
Response
Conventions
- A successful response is JSON with the result under
data. - Money is USD as a JSON number, rounded to 9 decimal places, so fractions of a cent still show. Sum large sets of figures with a decimal type if you need exact totals.
- Dates are UTC calendar days in
YYYY-MM-DDformat, and timestamps are ISO 8601 in UTC. prompt_tokenscounts every input token, including the ones served from the prompt cache;cached_tokensis the cached part of it.- Usage figures match the Analytics page. Recent usage can take a few minutes to appear, usage that billing hasn’t priced yet counts as 0 until it is, and costs can differ slightly from your final invoice.
Errors
Every error response is JSON with the HTTP status ascode and a message saying what went wrong:
Retry
429, 500, and 503 with backoff. A 400, 401, or 403 fails the same way until the request or the key changes.