Skip to main content
POST
Get costs by request IDs

Authorizations

Authorization
string
header
required

API key for programmatic access (Authorization: Bearer sk-<api_key>)

Body

application/json

Billing costs request (HuggingFace compatible)

requestIds
string<uuid>[]
required

Array of request IDs to get costs for: the UUID values of the inference-id response header returned by /v1/chat/completions and /v1/messages (not the x-request-id header).

Response

Costs retrieved successfully

Billing costs response (HuggingFace compatible)

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.