How to Check Billings
View your WaveSpeedAI billing history via API.
Endpoint
GET https://api.wavespeed.ai/api/v3/account/billingsRequest
curl --location --request GET 'https://api.wavespeed.ai/api/v3/account/billings' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}'Response
{
"code": 200,
"message": "success",
"data": {
"items": [
{
"id": "txn_abc123",
"type": "topup",
"amount": 100.00,
"currency": "USD",
"status": "completed",
"payment_method": "stripe",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": "txn_def456",
"type": "usage",
"amount": -15.50,
"currency": "USD",
"status": "completed",
"model": "wavespeed-ai/flux-dev",
"created_at": "2024-01-15T11:00:00.000Z"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total": 150
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Transaction ID |
type | string | topup or usage |
amount | number | Amount (negative for usage) |
status | string | Transaction status |
payment_method | string | Payment method (for topups) |
model | string | Model used (for usage) |
created_at | string | Transaction timestamp |
Query Parameters
| Parameter | Description | Example |
|---|---|---|
page | Page number | 1 |
page_size | Items per page | 50 |
type | Filter by type | topup or usage |
start_date | Start date | 2024-01-01 |
end_date | End date | 2024-01-31 |
Example: Filter by Type
# Get only top-ups
curl --location --request GET 'https://api.wavespeed.ai/api/v3/account/billings?type=topup' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}'Python Example
import os
import requests
api_key = os.environ.get("WAVESPEED_API_KEY")
def get_billings(page=1, type=None):
params = {"page": page}
if type:
params["type"] = type
response = requests.get(
"https://api.wavespeed.ai/api/v3/account/billings",
headers={"Authorization": f"Bearer {api_key}"},
params=params
)
return response.json()["data"]
# Get recent transactions
billings = get_billings()
for item in billings["items"]:
sign = "+" if item["type"] == "topup" else ""
print(f"{item['created_at']}: {sign}${item['amount']} ({item['type']})")Use Cases
| Use Case | Implementation |
|---|---|
| Audit trail | Track all transactions |
| Expense reports | Export for accounting |
| Payment history | Review top-up history |
| Usage analysis | Analyze spending patterns |
Invoices
For formal invoices, contact support@wavespeed.ai with:
- Account email
- Billing period
- Business information