How to Check Billings
Search billing records with optional filters such as billing type, prediction UUIDs, sort order, and time range. Returns paginated results.
Endpoint
POST https://api.wavespeed.ai/api/v3/billings/searchRequest
curl --location --request POST 'https://api.wavespeed.ai/api/v3/billings/search' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"page": 1,
"page_size": 10
}'Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
billing_type | string | No | - | Filter by billing type (e.g., deduct) |
prediction_uuids | array | No | - | Filter by one or more related prediction UUIDs |
sort | string | No | - | Sort order: created_at ASC or created_at DESC |
start_time | string | No | - | Start of time range (milliseconds since Unix epoch) |
end_time | string | No | - | End of time range (milliseconds since Unix epoch) |
page | integer | Yes | 1 | Page number (>=1) |
page_size | integer | Yes | 10 | Items per page (1-100) |
Response
{
"code": 200,
"message": "success",
"data": {
"page": 1,
"total": 1,
"items": [
{
"uuid": "d6b45aaa54fb4d12930acc36c9ae639f",
"billing_type": "deduct",
"price": 0.02,
"created_at": "2025-10-01T11:13:30.051Z",
"updated_at": "2025-10-01T11:13:30.051Z",
"order": {
"uuid": "2bf7346d433e4b0e9e70bc24e5e24644",
"state": "done",
"price": 0.02,
"origin_price": 0.02,
"status": "",
"ak_id": 0
},
"prediction": {
"uuid": "cb54bb552ff94e1ea6a5c2976fe1c0c1",
"model_uuid": "bytedance/seedream-v3",
"status": "completed"
},
"access_key_name": ""
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
data.page | integer | Current page number |
data.total | integer | Total number of records |
data.items | array | Array of billing records |
Billing Record Object
| Field | Type | Description |
|---|---|---|
uuid | string | Billing record UUID |
billing_type | string | Type of billing (e.g., deduct) |
price | float | Amount in USD |
created_at | string | Creation timestamp (ISO 8601) |
updated_at | string | Last update timestamp (ISO 8601) |
order | object | Related order information |
prediction | object | Related prediction information |
access_key_name | string | Name of the access key used |
Python Example
import os
import requests
api_key = os.environ.get("WAVESPEED_API_KEY")
def get_billings(page=1, page_size=10, billing_type=None):
payload = {
"page": page,
"page_size": page_size
}
if billing_type:
payload["billing_type"] = billing_type
response = requests.post(
"https://api.wavespeed.ai/api/v3/billings/search",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json=payload
)
return response.json()["data"]
# Get recent billings
billings = get_billings()
print(f"Total records: {billings['total']}")
for item in billings["items"]:
print(f"{item['created_at']}: ${item['price']} ({item['billing_type']})")Filter by Type
curl --location --request POST 'https://api.wavespeed.ai/api/v3/billings/search' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"billing_type": "deduct",
"page": 1,
"page_size": 10
}'Filter by Time Range
curl --location --request POST 'https://api.wavespeed.ai/api/v3/billings/search' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"start_time": "1759317210051",
"end_time": "1759317227408",
"sort": "created_at DESC",
"page": 1,
"page_size": 10
}'Filter by Prediction
curl --location --request POST 'https://api.wavespeed.ai/api/v3/billings/search' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"prediction_uuids": ["cb54bb552ff94e1ea6a5c2976fe1c0c1"],
"page": 1,
"page_size": 10
}'