Sync Billing
Force an immediate billing sync for all your API integrations. This updates balance and usage information from provider APIs.
Request
POST /api/v1/integrations/sync-billing
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer {client_token} | Yes |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
provider_name | string | Optional: sync only this provider |
Example Requests
Sync All Providers
curl -X POST "https://spideriq.ai/api/v1/integrations/sync-billing" \
-H "Authorization: Bearer $CLIENT_TOKEN"
Sync Specific Provider
curl -X POST "https://spideriq.ai/api/v1/integrations/sync-billing?provider_name=openrouter" \
-H "Authorization: Bearer $CLIENT_TOKEN"
Response
Success (200 OK)
{
"success": true,
"synced": 5,
"failed": 1,
"results": [
{
"id": 42,
"provider_name": "openrouter",
"status": "success",
"balance": 47.83,
"usage_today": 2.34,
"usage_month": 89.47,
"synced_at": "2026-02-26T15:45:00Z"
},
{
"id": 43,
"provider_name": "groq",
"status": "success",
"balance": null,
"usage_today": null,
"usage_month": null,
"synced_at": "2026-02-26T15:45:00Z",
"note": "Provider does not expose billing API"
},
{
"id": 44,
"provider_name": "mistral",
"status": "success",
"balance": 125.64,
"usage_today": 5.67,
"usage_month": 78.23,
"synced_at": "2026-02-26T15:45:00Z"
},
{
"id": 45,
"provider_name": "fal_ai",
"status": "failed",
"error": "API key invalid or expired",
"synced_at": "2026-02-26T15:45:00Z"
}
],
"total_balance": 173.47,
"total_usage_month": 167.70
}
Response Fields
| Field | Description |
|---|---|
synced | Number of integrations successfully synced |
failed | Number of integrations that failed to sync |
results | Per-integration sync results |
results[].balance | Current balance/credits (null if provider doesn't expose) |
results[].usage_today | Today's spend in USD |
results[].usage_month | This month's spend in USD |
results[].error | Error message if sync failed |
total_balance | Sum of all balances |
total_usage_month | Sum of monthly usage |
Provider Support
| Provider | Balance | Usage Today | Usage Month | Notes |
|---|---|---|---|---|
| OpenRouter | Yes | Yes | Yes | Full billing API |
| Mistral | Yes | Yes | Yes | Full billing API |
| Cohere | Yes | Yes | Yes | Full billing API |
| Groq | No | No | No | Free tier, no billing API |
| Cerebras | No | No | No | Free tier |
| fal.ai | Yes | No | Yes | Monthly usage only |
| Google AI | Yes | Yes | Yes | Requires billing project |
| Together | Yes | Yes | Yes | Full billing API |
| Others | Varies | Varies | Varies | Contact support |
Notes
- Automatic sync runs every 4 hours
- Manual sync is rate-limited to 1 request per minute
- Failed syncs update
billing_sync_erroron the integration - Successful syncs clear any previous sync errors
- Spend snapshots are saved for historical tracking