Get spending for a period
usage_getWhat this connection has spent over a period: requests, tokens, cache savings and the total in rubles. Same as GET /v1/usage. With an API key that is the key's spending; connected through OAuth, it is the spending of the whole app connection over the period, not just of the current hourly token.
Use it to report what a run cost, to check spending against a budget, or to see the charge of tools that do not return their own price (image_generate, speech_create). balance_get shows what is left on the account.
Free to call: it only reads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | Period: "today", "24h" (default), "7d", "30d" or "mtd" — month to date. All times in UTC. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | ||
| by_key | No | ||
| object | Yes | ||
| period | Yes | ||
| totals | Yes | ||
| buckets | Yes | ||
| by_model | No | ||
| granularity | Yes |