Skip to main content
The Usage section in your dashboard shows a detailed record of every request made with your API keys, along with aggregate statistics and a full transaction history.

What you can see

  • Usage log — every request with model name, prompt tokens, completion tokens, charged amount, and timestamp
  • Statistics — aggregate spend broken down by model
  • Transactions — a ledger of all balance debits and credits with descriptions
Open Dashboard → Usage to view the usage log and statistics. Open Dashboard → Transactions for the balance ledger.

Usage log

The usage log records each individual inference request charged to your account.
curl "https://modelswitch.io/api/usage?limit=50&offset=0" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
{
  "usage": [
    {
      "id": 1,
      "model": "gpt-4o",
      "promptTokens": 523,
      "completionTokens": 214,
      "chargedAmount": 0.00345,
      "createdAt": "2024-01-15T14:22:05Z"
    }
  ]
}

Aggregate statistics

Get totals and a per-model breakdown of your spending:
curl https://modelswitch.io/api/usage/stats \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
The response includes an overall stats object and a byModel array with per-model token counts and costs.

Transaction history

Transactions represent movements in your account balance — charges for API usage and credits from top-ups.
curl "https://modelswitch.io/api/transactions?limit=50&offset=0" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
{
  "transactions": [
    {
      "id": 1,
      "amount": -0.00345,
      "type": "usage",
      "description": "gpt-4o inference",
      "createdAt": "2024-01-15T14:22:05Z"
    }
  ]
}
Negative amounts are charges. Positive amounts are balance top-ups.

Pagination

Both /api/usage and /api/transactions support pagination via limit and offset query parameters. The maximum value for limit is 50.
# Second page of results
curl "https://modelswitch.io/api/usage?limit=50&offset=50" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Create a separate API key for each project. Since the usage log records which key was used for each request, you can filter by key to track spending per project.