Account
Get the token quota
Get your organization’s token allowance for the current period and how much is used.
GET
/
api
/
v2
/
quota
/
tokens
from hai_agents import Client
client = Client()
tokens = client.quota.get_token_quota()
print(tokens.remaining)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const tokens = await client.quota.getTokenQuota();
console.log(tokens.remaining);
curl https://agp.eu.hcompany.ai/api/v2/quota/tokens \
-H "Authorization: Bearer $HAI_API_KEY"
{
"limit": 60000000,
"used": 4200000,
"remaining": 55800000,
"window_start": "2026-06-01T00:00:00Z",
"window_end": "2026-07-01T00:00:00Z"
}
Past the allowance, sessions still start and their model calls are billed to your organization’s credit (Token usage).
Response
200 with the token quota object.
from hai_agents import Client
client = Client()
tokens = client.quota.get_token_quota()
print(tokens.remaining)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const tokens = await client.quota.getTokenQuota();
console.log(tokens.remaining);
curl https://agp.eu.hcompany.ai/api/v2/quota/tokens \
-H "Authorization: Bearer $HAI_API_KEY"
{
"limit": 60000000,
"used": 4200000,
"remaining": 55800000,
"window_start": "2026-06-01T00:00:00Z",
"window_end": "2026-07-01T00:00:00Z"
}
Errors
Only the common errors.Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
tokens = client.quota.get_token_quota()
print(tokens.remaining)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const tokens = await client.quota.getTokenQuota();
console.log(tokens.remaining);
curl https://agp.eu.hcompany.ai/api/v2/quota/tokens \
-H "Authorization: Bearer $HAI_API_KEY"
{
"limit": 60000000,
"used": 4200000,
"remaining": 55800000,
"window_start": "2026-06-01T00:00:00Z",
"window_end": "2026-07-01T00:00:00Z"
}