Skip to main content
POST
Get the cost of requests

Authorizations

Authorization
string
header
required

API key beginning with sk-, sent as Authorization: Bearer <key>.

Body

application/json

The request ids to price.

requestIds
string[]
required

The request ids to get costs for, at most 10,000. Each is the UUID in the inference-id response header of a chat completions or messages response (not the x-request-id header).

Maximum array length: 10000

Response

The cost of each request id.

The cost of each request id.

requests
object[]
required

Array of request costs

warning
string | null

Present when some request ids matched no usage record for this organization (those entries report costNanoUsd 0). Explains where the correct request ids come from.