API Reference
Wallet
Check wallet balance and transaction history.
Wallet
AssistantRouter uses a pre-paid wallet system. Check your balance and view transaction history.
Get Balance
GET
/v1/walletGet current wallet balance and auto-topup settings.
Response
{
"data": {
"balance_cents": 5000,
"reserved_cents": 50,
"available_cents": 4950,
"auto_topup_enabled": true,
"auto_topup_threshold_cents": 500,
"auto_topup_amount_cents": 2000
}
}Response Fields
Prop
Type
Example
curl https://api.assistantrouter.com/v1/wallet \
-H "Authorization: Bearer $API_KEY"const response = await fetch('https://api.assistantrouter.com/v1/wallet', {
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
},
});
const { data } = await response.json();
console.log(`Available: $${(data.available_cents / 100).toFixed(2)}`);Reserved balance: During streaming requests, we reserve an estimated amount. This is released after the request completes and actual costs are calculated.
Get Transaction History
GET
/v1/wallet/transactionsGet a list of wallet transactions.
Query Parameters
Prop
Type
Response
{
"data": [
{
"id": "txn_abc123",
"type": "topup",
"amount_cents": 2000,
"balance_after_cents": 5000,
"description": "Manual top-up",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "txn_xyz789",
"type": "usage",
"amount_cents": -15,
"balance_after_cents": 3000,
"description": "Chat completion - claude-haiku-4.5",
"created_at": "2024-01-15T09:15:00Z"
}
]
}Transaction Types
| Type | Description |
|---|---|
topup | Manual wallet top-up |
auto_topup | Automatic top-up triggered by threshold |
usage | API usage charge (negative amount) |
refund | Refund for failed requests |
adjustment | Manual balance adjustment |
How Billing Works
- Pre-paid balance: Add credits to your wallet before making API calls
- Per-request charging: Each request deducts from your balance based on token usage
- Streaming reservations: During streaming, we reserve an estimated amount that's adjusted after completion
- Auto top-up: Optionally enable automatic refills when balance drops below a threshold
When your available balance reaches zero, API requests will fail with an insufficient_balance error.
Auto Top-up
Configure automatic top-up in the dashboard to ensure uninterrupted service:
- Go to Settings > Billing
- Enable Auto Top-up
- Set a Threshold (e.g., $5.00)
- Set a Top-up Amount (e.g., $20.00)
When your balance drops below the threshold, we'll automatically charge your payment method and add the top-up amount to your wallet.