Back to Docs

Credits API

Check wallet balance and usage statistics

Overview

The Credits API allows you to check your current credit balance, view daily usage, and monitor your account tier status. These endpoints are free and do not consume credits.

✅ Free: Credit check endpoints do not cost any credits

GET/api/users/credits

Get your current credit balance and tier information.

Response

{
  "success": true,
  "data": {
    "tier": "Channel",
    "daily_limit": 2000,
    "daily_used": 500,
    "daily_remaining": 1500,
    "extra_credits": 100000,
    "total_available": 101500
  }
}

Example Request

curl "https://abhibots.com/api/users/credits" \
  -H "X-API-Key: your_api_key"
GET/api/users/usage

Get your recent usage history and statistics.

Query Parameters

ParameterTypeDefaultDescription
daysinteger7Number of days to fetch (max 30)
limitinteger50Number of records to return

Response

{
  "success": true,
  "data": {
    "total_credits_used": 45000,
    "total_generations": 120,
    "history": [
      {
        "date": "2024-01-15",
        "credits_used": 5000,
        "generations": 15
      },
      ...
    ]
  }
}

Python Example

import requests

API_KEY = "your_api_key"

# Check balance
response = requests.get(
    "https://abhibots.com/api/users/credits",
    headers={"X-API-Key": API_KEY}
)

data = response.json()
print(f"Tier: {data['data']['tier']}")
print(f"Available: {data['data']['total_available']} credits")

# Check if enough credits for 1000 char generation
if data['data']['total_available'] >= 1000:
    print("✅ Enough credits!")
else:
    print("❌ Need more credits")
Built by · Founder of AbhiBots