Endpoint
Overview
Retrieves the current credit balance for your tenant. This is a shared endpoint available to all key types.
Request
curl https://api.ones1ght.com/v1/credits \
-H "Authorization: Bearer $API_KEY"
Response
{
"success": true,
"data": {
"balance": 150.00
}
}
| Field | Description |
|---|
balance | Available credit balance (USD) |
Credits in Chat Response
POST /v1/chat/{persona_id} responses also include credit information:
{
"success": true,
"data": {
"thread_id": "thr_xxx",
"assistant_message": { ... },
"credits": {
"used": 289,
"balance": 149.50
}
}
}
| Field | Description |
|---|
credits.used | Tokens used in this request |
credits.balance | Remaining credit balance (USD) after the request |
When credits are depleted, chat API calls will return 402 Payment Required.