Get Cache Billing

GET/v1/billing/caches/{cache_id}

Returns settled creation charges, storage charges, and billed usage for one explicit cache. Billing remains queryable after the cache expires or is deleted.

Cache-read charges from inference requests are excluded. Use Get Request Usage for those inference charges.

Authentication

Authorization Bearer

Send an API key (sk-...) or user JWT in the Authorization header. You can query only caches owned by the authenticated account.

Path Parameters

cache_idstringrequired

Cache identifier: the part after cachedContents/ in the creation response name.

Response

codeinteger

Response status code.

msgstring

Response message.

dataobject | null
data.cache_idstring

Cache identifier: the part after cachedContents/ in the creation response name.

data.namestring

Cache resource name.

data.modelstring

Model used to create the cache.

data.currencystring

Currency of the amounts, USD.

data.statusstring

Cache state: pending, active, expired, deleted, or failed.

data.billing_statusstring

pending: creation has not settled; in_progress: charges have settled but further charges may follow; final: billing is complete.

data.billing_finalboolean

True only when cache billing is complete and no further settlement remains.

data.creationobject
data.storageobject
data.total_amountnumber

Sum of settled creation and storage charges. Excludes inference requests using this cache.

data.settled_throughstring | null

UTC ISO 8601 time through which storage has been settled; null before the first storage settlement.

data.checked_atstring

Time of this query in UTC ISO 8601.

service_codestring | null

Stable error code when available.

trace_idstring | null

Diagnostic identifier when available.

Settlement status

total_amount contains settled charges, not an estimate of future costs. Storage charges continue to accrue while the cache is in use. Final settlement can remain pending after deletion or expiration; check billing_final.

Before creation or storage has settled, its billed value is false and its amount is 0. This does not mean that the operation is free.

Error Handling

Check the response code, following the other billing lookup endpoints:

  • 401 / unauthenticated: missing or invalid credentials.
  • 404: unknown cache, invalid identifier, or a cache this account cannot access. Returns data: null.
  • 503 / CACHE_BILLING_UNAVAILABLE: a reliable billing summary is temporarily unavailable. Retry later; contact support if it persists.

Solicitar

Shell
1curl -sS "https://api.token360.ai/v1/billing/caches/0123456789abcdef0123456789abcdef" \
2  -H "Authorization: Bearer sk-your-api-key"

Respuesta

JSON
1{
2  "code": 200,
3  "msg": "success",
4  "data": {
5    "cache_id": "0123456789abcdef0123456789abcdef",
6    "name": "cachedContents/0123456789abcdef0123456789abcdef",
7    "model": "example-gemini-model",
8    "currency": "USD",
9    "status": "expired",
10    "billing_status": "final",
11    "billing_final": true,
12    "creation": {
13      "billed": true,
14      "total_amount": 0.2,
15      "usage": {
16        "input_tokens": 1000000
17      }
18    },
19    "storage": {
20      "billed": true,
21      "total_amount": 0.5,
22      "usage": {
23        "cache_tokens_stored_hours": 500000
24      }
25    },
26    "total_amount": 0.7,
27    "settled_through": "2026-11-06T12:30:00Z",
28    "checked_at": "2026-11-06T12:31:00Z"
29  },
30  "service_code": null,
31  "trace_id": null
32}
¿Ha sido de ayuda?
Get Cache Billing · Token360