DocumentationAPI reference

API reference

Charged tokens

Each finished request reports the same Charged amount shown in the dashboard.

Charged amount

#

A finished JSON response includes xedoc.charged_tokens. That is the amount deducted from the balance for the request, the same number shown as Charged.

Responsejson
{
  "xedoc": {
    "charged_tokens": 97.5,
    "billing_status": "settled"
  }
}

While a request is still running, or final usage has not arrived, charged_tokens is null and billing_status is pending or unresolved. After a stream finishes, read the same fields from GET /v1/usage/{id}. GET /v1/usage lists them for the key used on the request.