meta-tools.token_balance
Get the token balance for this API key.
When the key belongs to a project that has a spend cap, the allowance, tokens used, and tokens remaining are that cap for the current billing period. Every other key gets the account allowance and usage. The response includes the billing plan and when the period resets. Use this before expensive calls or when a call returns 402.
Cost = 0 tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokens_used | No | Tokens already counted against that limit in the current billing period. | |
| billing_plan | No | Current billing plan id (free, starter, pro, scale). | |
| tokens_remaining | No | Tokens left before that limit is reached. | |
| billing_period_end | No | ISO 8601 end of the current billing period. | |
| billing_period_start | No | ISO 8601 start of the current billing period. | |
| monthly_token_allowance | No | Token limit for this key in the current billing period. A project key whose project has a spend cap reports that cap. Otherwise this is the account's monthly allowance. | |
| billing_period_resets_at | No | ISO 8601 timestamp when the token allowance resets (same as period end). |