Billing & top-ups
How billing works
Section titled “How billing works”MirAPI is prepaid. You top up a USD balance at https://platform.mirapi.ai and every request draws from it. There is no subscription, no monthly fee, and no minimum commitment. Your balance never expires.
You top up in your local currency at the day’s exchange rate. The credited amount is recorded in USD, and the rate is locked at the moment of payment. All three supported protocols (OpenAI-compatible, Anthropic, and Gemini) draw from the same balance, so one top-up covers every endpoint you use.
Pricing units
Section titled “Pricing units”How a request is billed depends on the model’s output type:
| Output type | Billed by | Notes |
|---|---|---|
| Text and multimodal chat | Tokens | Input, output, and cache-read tokens are priced separately, per 1M tokens |
| Image generation | Image | One charge per generated image; Gemini image models (Nano Banana) called through generateContent are billed per token instead |
| Video generation | Seconds | Per second of generated video output |
Token pricing
Section titled “Token pricing”Text models charge for three token tiers (input, output, and cache read), each priced in USD per 1M tokens. A cache-read token costs less than a fresh input token; the exact rate is on the model’s catalog entry. Reasoning/thinking tokens are billed as output tokens. See Prompt caching for how to make your requests hit the cache.
Where to find prices
Section titled “Where to find prices”The catalog is the authoritative source for pricing. GET /v1/models returns a pricing object per model with per-1M-token input, output, and cache-read rates (see Models & pricing); the Platform shows the same figures. Always check the current price before a large run.
A non-streaming response’s usage reports token counts only, never a dollar amount. The cost is recorded in the Platform billing log and in GET /api/log/token.
Top-ups and redemption codes
Section titled “Top-ups and redemption codes”- Top up at https://platform.mirapi.ai in your local currency at the day’s rate; the credited amount is USD and the rate is locked when you pay.
- Redemption codes (for example from promotions) are entered under Billing → Redeem in the Platform and add USD to the same balance.
When the balance runs out
Section titled “When the balance runs out”An exhausted balance does not suspend your account. Requests fail with HTTP 403 and an error message stating that the balance is insufficient. Top up and the same key works again immediately, with no re-authentication and no new key. See Errors for the full error reference.
Reconciliation
Section titled “Reconciliation”Three sources show the same billing data:
| Source | Scope |
|---|---|
| Platform billing log | Per-request entries with model, channel, token counts, cost, and balance after the call |
GET /api/usage/token |
Account-level usage summary |
GET /api/log/token |
Per-request detail log, queryable by key and time range |
If you think you were charged incorrectly, open a ticket and include the request ID. It is appended to every error message, and you can read it from your own logs. Support uses it to look up the exact request and its billing entry.
Related links
Section titled “Related links”- Models & pricing: catalog and per-model pricing
- Prompt caching: cut input costs with cache reads
- Quickstart
- FAQ
- Errors: 403 and other status codes