Skip to main content
GET
/
payment
/
usage
/
{api_token}
Usage Api Token
curl --request GET \
  --url https://api.example.com/payment/usage/{api_token} \
  --header 'Authorization: Bearer <token>'
{
  "months": [
    {
      "period": "<string>",
      "interval": {
        "fr": 0,
        "to": 4000000000000
      },
      "items": [
        {
          "model": {
            "provider": "<string>",
            "model_name": "<string>",
            "task": "<string>",
            "plan_id": "<string>",
            "private": false
          },
          "units": 123,
          "rate": 123,
          "cost": 123,
          "pricing_type": "<string>",
          "interval": {
            "fr": 0,
            "to": 4000000000000
          },
          "discount": {
            "name": "<string>",
            "description": "<string>"
          }
        }
      ],
      "total_cost": 123,
      "invoice_id": "NOT_FINAL"
    }
  ],
  "initial_month": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

api_token
string
required

Query Parameters

from
string
required

start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format

to
string | null

end of period (if missing a single month marked by from is return), same format as from

Cookies

session
String

Response

Successful Response

months
UsageMonth · object[]
required
initial_month
string
required

The first month for this account