Toknix provides developer account endpoints allowing automated agents, monitoring dashboards, and alert pipelines to query balances and consumption without human intervention.
GET /v1/balance
Read current available prepaid funds in USD. This endpoint is free and continues to respond even when account balance is zero.
bash
curl https://api.toknix.in/v1/balance -H "Authorization: Bearer $TOKNIX_API_KEY"json
{
"object": "balance",
"currency": "USD",
"balance_usd": 42.8521,
"account_id": "8391047215",
"status": "active"
}GET /v1/usage
Returns token consumption metrics aggregated over rolling 1-hour, 24-hour, and 7-day windows:
bash
curl https://api.toknix.in/v1/usage -H "Authorization: Bearer $TOKNIX_API_KEY"json
{
"object": "usage",
"windows": {
"1h": {
"total_tokens": 142050,
"input_tokens": 120000,
"output_tokens": 12050,
"cached_tokens": 10000,
"cost_usd": 0.0412,
"cache_savings_usd": 0.0825
},
"24h": {
"total_tokens": 2840000,
"input_tokens": 2400000,
"output_tokens": 240000,
"cached_tokens": 200000,
"cost_usd": 0.8240,
"cache_savings_usd": 1.6500
}
}
}GET /v1/status
Returns real-time upstream health telemetry for every model accessible to your key:
bash
curl https://api.toknix.in/v1/status -H "Authorization: Bearer $TOKNIX_API_KEY"json
{
"summary": {
"total_models": 40,
"healthy": 39,
"degraded": 1,
"offline": 0
},
"models": {
"claude-opus-5-5": "up",
"gpt-6-astra": "up",
"glm-5.3-flash": "up"
}
}