Skip to main content
GET
Get Request Cost
This endpoint queries the cost of synchronous API calls, primarily to text models through Chat Completions, Messages, or Responses.Use the value of the X-Request-Id header from the original response as the Request ID. Wait a moment after the request completes before querying. For asynchronous tasks, use Get task status.

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication.

Get an API Key:

Visit the API Key management page to obtain your API Key.

Include the following request header:

Path Parameters

request_id
string
required

Request ID from the X-Request-Id header of the original response. Omit the braces ({}) and append the ID directly to the path.

Maximum string length: 64

Response

Query successful

id
string
required

Request ID

Example:

"20261117223155519063884QnAx70lK"

object
enum<string>
required

Object type; always request

Available options:
request
Example:

"request"

model
string
required

The model used for the request

Example:

"claude-haiku-5-5"

status
enum<string>
required

Request status:

  • completed: The request completed successfully.
  • failed: The request failed. If usage occurred before the failure (for example, a streaming response was interrupted), usage reports the charges actually deducted.
  • blocked: The request was rejected before processing, for example because of insufficient account balance, an exhausted API Key quota, a disabled or expired API Key, or a model that is not allowed. No charges are incurred.
Available options:
completed,
failed,
blocked
Example:

"completed"

finished_at
integer
required

Time the request ended (Unix timestamp in seconds)

Example:

1794925917

usage
object
required

Usage and cost. Always returned; all values are 0 if no charges were incurred.

error
object

The failure reason, returned only when status is failed or blocked. Contains a message only, without an error code. To handle errors by code, use the error returned by the original request.