YTAPI.devDocs

Balance & Limits

Check your account tier, credit balance and free-tier daily quota with GET /v1/balance. Free, and never blocked by the daily quota.

GET /v1/balance returns your account tier, remaining credit balance and, on the free tier, the daily quota. It costs 0 credits and is never blocked by a 429 daily-quota error, so free users can always see when their quota resets.

GET /v1/balance
Authorization: Bearer YOUR_API_KEY

GET /v1/user/balance is also available as an alias.

Response

{
  "tier": "paid",
  "credit_balance": 303,
  "daily_quota": null
}
{
  "tier": "free",
  "credit_balance": 200,
  "daily_quota": {
    "limit": 100,
    "remaining": 85,
    "resets_in_seconds": 15420
  }
}
FieldTypeDescription
tierstringfree or paid
credit_balanceintegerCredits left on the account
daily_quotaobject or nullFree tier only: limit, remaining and resets_in_seconds for today's quota. null on paid accounts

Examples

curl "https://api.ytapi.dev/v1/balance" \
  -H "Authorization: Bearer $YTAPI_API_KEY"
# pip install ytapi-sdk
from ytapi import YTAPI

api = YTAPI()  # reads YTAPI_API_KEY
print(api.get_balance())
// npm install @ytapi/sdk
import { YTAPI } from "@ytapi/sdk";

const api = new YTAPI(); // reads YTAPI_API_KEY
console.log(await api.getBalance());

Balance on every response

Billed responses also carry X-Credits-Consumed and, when available, X-Credits-Remaining. X-Credits-Remaining is an estimate that can lag by a few seconds. Use GET /v1/balance when you need the exact figure. See Credits, Rate Limits & Errors.

On this page