Skip to main content

Endpoint

GET /v1/credits

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
  }
}
FieldDescription
balanceAvailable 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
    }
  }
}
FieldDescription
credits.usedTokens used in this request
credits.balanceRemaining credit balance (USD) after the request
When credits are depleted, chat API calls will return 402 Payment Required.