Billing & Credits
Manage your wallet, track costs, and optimize spending.
Billing & Credits
AssistantRouter uses a pre-paid wallet system for transparent cost management.
Wallet System
Your workspace has a wallet that holds credits. API requests deduct credits based on token usage.
Adding Credits
- Go to Billing in the dashboard
- Click Add Credits
- Choose an amount and complete payment
- Credits are available immediately
Credit Pricing
| Amount | Price |
|---|---|
| $10 | $10.00 |
| $25 | $25.00 |
| $50 | $50.00 |
| $100 | $100.00 |
| $500 | $500.00 |
How Costs Are Calculated
Costs are based on:
- Input tokens - Tokens in your prompt
- Output tokens - Tokens generated by the model
- Model pricing - Each model has different rates
- Tool usage - Web search and RAG have additional costs
Total = LLM cost + Tool costs
LLM cost = (input_tokens × input_rate) + (output_tokens × output_rate)View real-time costs for each request in the response's x_assistantrouter.cost_cents field.
Streaming Reservations
When streaming responses, credits are reserved upfront and adjusted after completion:
- Reserve - Estimated cost is reserved from available balance
- Stream - Response streams to the client
- Settle - Actual cost is calculated, excess is refunded
This ensures you never run out of credits mid-stream.
Auto Top-up
Enable automatic top-up to ensure uninterrupted service:
- Go to Settings > Billing in the dashboard
- Enable Auto Top-up
- Set a Threshold (default: $5.00)
- Set a Top-up Amount (default: $25.00)
When your balance drops below the threshold, we automatically charge your payment method.
Checking Balance via API
Get your current balance:
const response = await fetch('https://api.assistantrouter.com/v1/wallet', {
headers: {
'Authorization': `Bearer ${process.env.API_KEY}`,
},
});
const { data } = await response.json();
console.log(`Balance: $${(data.balance_cents / 100).toFixed(2)}`);
console.log(`Available: $${(data.available_cents / 100).toFixed(2)}`);Response:
{
"data": {
"balance_cents": 5000,
"reserved_cents": 50,
"available_cents": 4950,
"auto_topup_enabled": true,
"auto_topup_threshold_cents": 500,
"auto_topup_amount_cents": 2500
}
}Monitoring Usage
Dashboard Analytics
View usage analytics in the dashboard:
- Daily/weekly/monthly spending
- Costs by assistant
- Costs by model
- Token usage trends
API Usage Endpoint
Get usage statistics via API:
const response = await fetch('https://api.assistantrouter.com/v1/usage', {
headers: {
'Authorization': `Bearer ${process.env.API_KEY}`,
},
});
const { data } = await response.json();Response:
{
"data": {
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"summary": {
"total_requests": 1250,
"total_tokens": 450000,
"total_cost_cents": 125,
"average_latency_ms": 850
},
"by_model": [
{
"model": "anthropic/claude-haiku-4.5",
"requests": 800,
"cost_cents": 95
}
]
}
}See the Usage API reference for more options.
Cost Optimization
- Choose appropriate models - Use cheaper models (Gemini 2.5 Flash, Claude Haiku 4.5) for simple tasks
- Optimize prompts - Shorter prompts = fewer input tokens
- Set max_tokens - Limit response length when possible
- Use conversations - Reuse conversation context instead of repeating history
- Monitor regularly - Review usage patterns in the dashboard
Insufficient Balance
If your wallet runs low, requests will fail with insufficient_balance:
{
"error": {
"type": "insufficient_balance",
"message": "Insufficient balance. Please add credits.",
"required_cents": 10,
"available_cents": 5
}
}Enable auto top-up or set up low balance alerts to avoid service interruptions.
Transaction History
View your transaction history via API:
const response = await fetch('https://api.assistantrouter.com/v1/wallet/transactions', {
headers: {
'Authorization': `Bearer ${process.env.API_KEY}`,
},
});
const { data } = await response.json();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"
}
]
}Invoices & Receipts
- Invoices are generated for each credit purchase
- Download from Billing > Invoices in the dashboard
- Available in PDF format for accounting