Endpoints
Balance & key info
Read your USD balance, key limits and usage with GET /credits and GET /key, and check what is left before a request fails.
Read your account's USD balance, total spend and the calling key's rate limit. Two paths return the same body: /credits and /key, a shorter alias.
GET https://api14.com/api/v1/credits
GET https://api14.com/api/v1/key
All amounts are US dollars.
Request
No parameters. Authenticate with your API key:
curl https://api14.com/api/v1/credits \
-H "Authorization: Bearer sk-api14-..."
Response
{
"data": {
"total_credits": 145.0,
"total_usage": 102.82,
"balance_usd": 42.18,
"key_id": "ckey_01JABCDEF",
"rate_limit": { "requests": 120, "interval": "1m" }
}
}
| Field | Description |
|---|---|
total_credits | Total USD ever added to the account: top-ups, subscription included usage, bonuses and promo codes. |
total_usage | Total USD spent on requests. |
balance_usd | Current spendable balance in USD. |
key_id | The id of the API key used for this request. |
rate_limit.requests | The key's own requests-per-minute limit, or null if the key uses your plan's limit. |
rate_limit.interval | Always 1m. |
total_credits - total_usage can differ slightly from balance_usd because of refunds and manual adjustments; balance_usd is authoritative.
Example: stop before running out
import os, requests
r = requests.get(
"https://api14.com/api/v1/credits",
headers={"Authorization": f"Bearer {os.environ['API14_API_KEY']}"},
)
balance = r.json()["data"]["balance_usd"]
if balance < 1:
raise SystemExit(f"Balance low: ${balance:.2f}. Add funds at /dashboard/billing")
curl -s https://api14.com/api/v1/key \
-H "Authorization: Bearer $API14_API_KEY" | jq '.data.balance_usd'
When the balance hits $0
Paid requests return 402 insufficient_balance until you add funds, unless auto top-up is enabled in Billing. Reading /credits, /key and /models keeps working. See Pricing & billing.
Errors
| Status | Code | When |
|---|---|---|
| 401 | invalid_api_key | Missing or invalid key. |
See Errors.