Monitoring
Monitor your AICredits usage, costs, and request logs. Built-in dashboard, per-model breakdown, and export options.
Use this page with an AI assistant
Opens a new chat with this docs URL and the correct AICredits base URLs.
Every request you make through AICredits is automatically logged. The Usage Dashboard gives you a real-time view of your spend, model distribution, and request history.
Usage Dashboard
Access Dashboard → Usage to see:
- Total spend — INR cost per day, week, or month
- Token usage — prompt and completion tokens over time
- Model breakdown — which models you use most and their relative cost
- Request history — individual requests with model, tokens, cost, and timestamp
- API key breakdown — costs per API key (useful for multi-key setups)
The dashboard updates in real time — requests appear within a few seconds of completion.
Request Logs
Each row in the request log shows:
| Field | Description |
|---|---|
| Timestamp | When the request was made |
| Model | Model ID used (e.g. openai/gpt-4o-mini) |
| Provider | Which upstream provider served it |
| Prompt tokens | Input tokens counted |
| Completion tokens | Output tokens generated |
| Cost (INR) | Total charge in INR |
| Status | Success, error code if failed |
Request and response content is stored for 30 days by default. If your account has metadata_only retention, only the metadata above is logged — content is never stored. See Data Retention for details.
Spend Alerts
Set a monthly spend cap on your API key to prevent unexpected charges. When the key's budget_decimal is reached, requests return 402 Insufficient Funds until you reset or increase the budget.
Configure this in Dashboard → API Keys when creating or editing a key.
Exporting Data
Usage data can be accessed programmatically:
# Get balance
curl https://api.aicredits.in/api/billing/balance \
-H "Authorization: Bearer sk-your-key-here"
# Get transaction history
curl "https://api.aicredits.in/api/billing/transactions?limit=100" \
-H "Authorization: Bearer sk-your-key-here"For analytics integrations, query the transaction history endpoint and aggregate by model, date, or API key in your own data warehouse.
Prometheus Metrics
If you're running a self-hosted AICredits deployment, Prometheus metrics are exposed at /metrics:
| Metric | Description |
|---|---|
aicredits_requests_total | Total requests by provider, model, status |
aicredits_request_duration_seconds | Request latency histogram |
aicredits_tokens_total | Token usage by type (prompt/completion) |
aicredits_cost_usd_total | Total cost in USD by provider |
These metrics are for server operators. The hosted platform at api.aicredits.in does not expose public Prometheus metrics.