fal.ai billing-events API returns 500 - affects image recovery
Summary
The fal.ai /v1/models/billing-events API endpoint consistently returns HTTP 500 "Unexpected server error" despite correct authentication. This endpoint is documented to return individual request IDs which are needed to recover generated images.
Context
We need to recover ~720 AI-generated ingredient images from fal.ai that were accidentally deleted. The images still exist on fal.ai's CDN and are visible in the dashboard, but we need the request IDs to access them via the queue API.
What Works
| Endpoint | Status | Notes |
|----------|--------|-------|
| /v1/models/usage | ✅ Works | Returns aggregated usage (no request IDs) |
| /v1/models/pricing | ✅ Works | Returns pricing info |
| queue.fal.run/.../requests/{id} | ✅ Works | Returns images IF you have request ID |
What Doesn't Work
# This should return request IDs per the OpenAPI spec
curl -s "https://api.fal.ai/v1/models/billing-events?limit=5" \
-H "Authorization: Key YOUR_ADMIN_KEY"
# Returns:
{"error":{"type":"server_error","message":"Unexpected server error"}}
Tested variations:
- With/without
endpoint_idfilter - With/without date range (
start/end) - Different date formats (ISO8601, date-only)
- All return 500
OpenAPI Spec Shows It Should Work
From https://api.fal.ai/v1/openapi.json:
{
"operationId": "getBillingEvents",
"summary": "Billing Events",
"description": "Returns paginated individual billing event records...",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"billing_events": {
"items": {
"properties": {
"request_id": { "type": "string" },
"endpoint_id": { "type": "string" },
"timestamp": { "type": "string" }
}
}
}
}
}
}
}
}
}
}
Workaround
Using browser console scraper to extract request IDs from the fal.ai dashboard UI.
Impact
Cannot programmatically recover ~720 generated images (~$28.70 worth) without manual dashboard scraping.
---
This issue was created to track a fal.ai API bug encountered during HalalLens development
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗