View balance transaction history
curl --request GET \
--url https://modelswitch.io/api/transactions{
"transactions": [
{
"id": 123,
"amount": 123,
"type": "<string>",
"description": "<string>",
"createdAt": "<string>"
}
]
}Authorization: Bearer YOUR_JWT_TOKEN
limit for pagination.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"
}, {
"id": 2,
"amount": 1000.00,
"type": "payment",
"description": "Balance top-up",
"createdAt": "2024-01-14T09:00:00Z"
}]
}
Show properties
"usage" (inference charge), "payment" (balance top-up), or "refund".| Type | Amount | Description |
|---|---|---|
usage | Negative | Deducted for an inference request |
payment | Positive | Balance top-up via payment |
refund | Positive | Refund credited to account |
limit and offset to page through results. limit is capped at 50 per request.
To retrieve your current balance directly, use the Balance API.curl --request GET \
--url https://modelswitch.io/api/transactions{
"transactions": [
{
"id": 123,
"amount": 123,
"type": "<string>",
"description": "<string>",
"createdAt": "<string>"
}
]
}