MIOSA uses a credit-based billing system. Credits are consumed for compute time and AI API calls.
Base path: /api/v1/credits
Get Balance
GET /api/v1/credits/balance
Returns the current credit balance for your tenant.
Response - 200 OK
{
"tenant_id": "550e8400-e29b-41d4-a716-446655440000",
"balance_credits": 850,
"lifetime_earned": 1000,
"lifetime_spent": 150,
"credit_expiry_at": "2026-10-08T00:00:00Z",
"updated_at": "2026-04-11T15:00:00Z"
} Response Fields
| Field | Type | Description |
|---|---|---|
tenant_id | UUID | Your tenant ID |
balance_credits | integer | Current available credits |
lifetime_earned | integer | Total credits ever earned (purchases + promos) |
lifetime_spent | integer | Total credits ever spent |
credit_expiry_at | ISO 8601 | When current credits expire (180 days from purchase) |
updated_at | ISO 8601 | Last balance change |
If no credit balance record exists yet, returns zeros:
{
"tenant_id": "...",
"balance_credits": 0,
"lifetime_earned": 0,
"lifetime_spent": 0,
"credit_expiry_at": null,
"updated_at": null
} curl https://api.miosa.ai/api/v1/credits/balance
-H "Authorization: Bearer $MIOSA_API_KEY" Get Transactions
GET /api/v1/credits/transactions
Returns paginated credit transaction history.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
page_size | integer | 20 | Items per page (max: 100) |
Response - 200 OK
{
"transactions": [
{
"id": "uuid",
"tenant_id": "uuid",
"user_id": "uuid",
"computer_id": "uuid",
"type": "spend",
"amount_credits": -5,
"description": "LLM API call",
"provider": "ollama",
"model": "nemotron-3-super",
"input_tokens": 1500,
"output_tokens": 500,
"cost_usd_micros": 250,
"inserted_at": "2026-04-11T15:00:00Z"
},
{
"id": "uuid",
"tenant_id": "uuid",
"user_id": "uuid",
"computer_id": null,
"type": "earn",
"amount_credits": 1000,
"description": "Starter plan monthly credits",
"provider": null,
"model": null,
"input_tokens": null,
"output_tokens": null,
"cost_usd_micros": null,
"inserted_at": "2026-04-01T00:00:00Z"
}
],
"total": 47,
"page": 1,
"page_size": 20
} Transaction Fields
| Field | Type | Description |
|---|---|---|
id | UUID | Transaction ID |
tenant_id | UUID | Tenant ID |
user_id | UUID | User who triggered the transaction |
computer_id | UUID | Associated computer (if applicable) |
type | string | "earn" or "spend" |
amount_credits | integer | Credits (positive = earned, negative = spent) |
description | string | Human-readable description |
provider | string | LLM provider (for AI transactions) |
model | string | Model name (for AI transactions) |
input_tokens | integer | Input tokens used (for AI transactions) |
output_tokens | integer | Output tokens generated (for AI transactions) |
cost_usd_micros | integer | Cost in microdollars (1/1,000,000 USD) |
inserted_at | ISO 8601 | Transaction timestamp |
curl "https://api.miosa.ai/api/v1/credits/transactions?page=1&page_size=50"
-H "Authorization: Bearer $MIOSA_API_KEY" Get Usage Summary
GET /api/v1/credits/usage
Returns daily usage rollups grouped by provider and model.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
from | ISO 8601 | 30 days ago | Start of date range |
to | ISO 8601 | Now | End of date range |
Response - 200 OK
{
"usage": [
{
"day": "2026-04-11T00:00:00Z",
"provider": "ollama",
"model": "nemotron-3-super",
"credits_spent": 45,
"input_tokens": 15000,
"output_tokens": 5000,
"cost_usd_micros": 2250,
"call_count": 12
},
{
"day": "2026-04-10T00:00:00Z",
"provider": "ollama",
"model": "nemotron-3-super",
"credits_spent": 30,
"input_tokens": 10000,
"output_tokens": 3000,
"cost_usd_micros": 1500,
"call_count": 8
}
],
"from": "2026-03-12T00:00:00Z",
"to": "2026-04-11T15:00:00Z"
} Usage Entry Fields
| Field | Type | Description |
|---|---|---|
day | ISO 8601 | Date (truncated to day) |
provider | string | LLM provider |
model | string | Model name |
credits_spent | integer | Total credits spent that day |
input_tokens | integer | Total input tokens |
output_tokens | integer | Total output tokens |
cost_usd_micros | integer | Total cost in microdollars |
call_count | integer | Number of API calls |
Errors
| Status | Error | Cause |
|---|---|---|
| 400 | invalid 'from' timestamp | Not valid RFC 3339 |
| 400 | invalid 'to' timestamp | Not valid RFC 3339 |
| 400 | 'from' must be before 'to' | Invalid date range |
curl "https://api.miosa.ai/api/v1/credits/usage?from=2026-04-01T00:00:00Z&to=2026-04-11T23:59:59Z"
-H "Authorization: Bearer $MIOSA_API_KEY" Credit Pricing
Compute Credits
| Size | Credits/hour |
|---|---|
| Small (4GB/1CPU) | 3 |
| Medium (8GB/2CPU) | 6 |
| Large (16GB/4CPU) | 12 |
AI Credits (per 1M tokens)
| Tier | Input | Output |
|---|---|---|
| Standard models | 10 | 20 |
| Advanced models | 60 | 100 |
Plans
| Plan | Price/month | Credits |
|---|---|---|
| Free | $0 | 100 |
| Starter | $29 | 1,000 |
| Pro | $79 | 3,000 |
| Scale | $199 | 10,000 |
Credits expire 180 days from purchase. Unused plan credits do not roll over.
See also
- API Reference overview - base URL and authentication
- Error Codes -
INSUFFICIENT_CREDITSerror handling - Workspaces - workspace and tenant management