Credit Balance API
Query the remaining credit balance for the API key owner.
Endpoint
GET https://api.goanyapi.com/api/v1/credits/balanceThis endpoint is free. It does not consume credits or create a credit consumption record.
Authentication
Authorization: Bearer YOUR_API_KEYRequest Parameters
No request parameters are required.
Example
curl "https://your-domain.com/api/v1/credits/balance" \
-H "Authorization: Bearer YOUR_API_KEY"Response Example
{
"code": "ok",
"message": "ok",
"data": {
"remainingCredits": 12500
}
}Response Fields
| Field | Description |
|---|---|
data.remainingCredits | Current available credits |
Only active, unexpired credits are included in the balance.
Errors
| HTTP Status | Code | Description |
|---|---|---|
| 401 | missing_api_key | Authorization header missing |
| 401 | invalid_api_key | API key is invalid |
| 401 | invalid_api_key_owner | API key owner does not exist |
| 429 | rate_limit_exceeded | Too many requests |
| 500 | internal_error | Internal server error |
Test the Endpoint
You can select Credit Balance API in the Open API Tester. The tester sends a real request but does not deduct credits.