メインコンテンツへスキップ
GET
/
usage
/
credits
Get Credit Usage
curl --request GET \
  --url https://api.cartesia.ai/usage/credits \
  --header 'Authorization: Bearer <token>' \
  --header 'Cartesia-Version: <cartesia-version>'
{
  "data": [
    {
      "start_ts": "2026-01-01T00:00:00.000Z",
      "end_ts": "2026-01-02T00:00:00.000Z",
      "credits": 123
    }
  ]
}

承認

Authorization
string
header
必須

Cartesia admin API key (sk_car_admin_...). Get one at play.cartesia.ai/keys/admin.

ヘッダー

Cartesia-Version
enum<string>
必須

API version header.

利用可能なオプション:
2026-03-01
:

"2026-03-01"

クエリパラメータ

start_ts
string<date-time> | null

Start of the time window, as an RFC 3339 datetime (with timezone). Defaults to a few days before end_ts. Rounded down to the start of the UTC day. start_ts to end_ts cannot span more than a year.

:

"2026-01-01T00:00:00Z"

end_ts
string<date-time> | null

End of the time window, as an RFC 3339 datetime (with timezone). Defaults to now. Rounded up to the start of the next UTC day, unless already at midnight. start_ts to end_ts cannot span more than a year.

:

"2026-01-02T00:00:00Z"

interval
enum<string> | null

Omit to receive a single bucket spanning from start_ts to end_ts. Groups usage data into buckets according to time.

利用可能なオプション:
day,
week,
month
api_key_id
string | null

If provided, only returns usage attributable to the given API key.

レスポンス

200 - application/json
data
UsageCreditsBucket · object[]
必須

Credit usage buckets in chronological order. Buckets with no recorded usage are returned with credits: 0.