Check Balance

How to Check Balance

Check your WaveSpeedAI account balance (in USD).

Endpoint

GET https://api.wavespeed.ai/api/v3/balance

Request

curl --fail-with-body --connect-timeout 10 --max-time 60 --request GET 'https://api.wavespeed.ai/api/v3/balance' \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}"

Response

{
  "code": 200,
  "message": "success",
  "data": {
    "balance": 50.25
  }
}

Response Fields

FieldTypeDescription
codeintegerHTTP status code (200 for success)
messagestringStatus message
data.balancenumberAccount balance in USD

Python Example

import os
import requests
 
api_key = os.environ["WAVESPEED_API_KEY"]
 
def check_balance():
    response = requests.get(
        "https://api.wavespeed.ai/api/v3/balance",
        headers={"Authorization": f"Bearer {api_key}"},
        timeout=(10, 60),
    )
    response.raise_for_status()
    body = response.json()
    if body.get("code") != 200:
        raise RuntimeError(body.get("message", "Failed to retrieve balance"))
    return body["data"]["balance"]
 
# Check balance
balance = check_balance()
print(f"Current balance: ${balance}")
 
# Check before expensive operation
if balance < 10:
    print("Warning: Low balance, consider topping up")

Use Cases

Use CaseDescription
Pre-checkVerify balance before expensive tasks
MonitoringTrack spending over time
AlertsNotify when balance is low
AutomationAuto-pause when balance depleted
© 2026 WaveSpeedAI. All rights reserved.