The API is pay as you go, with no subscription. Each workspace has an API wallet, counted in credits and topped up in euros. Each request draws on the balance of the workspace that owns the key sending it.
Credits and eurosLink to the Credits and euros section
- The API counts in credits: the prices in
GET /, the balance inv1/ models GET /and the cost of each request are in credits.v1/ credits - The portal shows everything in euros: the “Models” tab gives prices in euros, and the “Top up” form shows how many credits you get for an amount (“You receive”).
- A model’s price follows its provider’s price, plus the Moon AI margin. It can change along with it: read it from
/v1/modelsrather than hard-coding it.
BalanceLink to the Balance section
You can read the wallet balance in the portal’s “Overview” tab, or through the API with GET / (reference: Read the balance). It includes paid credits, free credits and the API credit included in your plan, and already deducts the hold of in-flight requests.
Cost of a requestLink to the Cost of a request section
Each response carries the X-Moon-Request-Id header, the request ID (gen- followed by 32 characters). The cost shows up in three places:
- in media responses:
usage.credits(images, embeddings, transcription, OCR, finished video) or theX-Moon-Creditsheader (speech, transcription); - for any request, with
GET /(reference: Read the cost of a request);v1/ generation? id= … - in the portal’s “Usage” tab, which lists recent requests with their cost, latency and time to first token (open).
A chat response gives the tokens in usage, never the cost.
Hold, then actual costLink to the Hold, then actual cost section
A request is paid for in two steps.
- Before the call, it holds the most it can cost from the balance. If the balance or a spend cap cannot cover this hold, the request is refused before any call to the model.
- After the response, the hold is settled at the actual cost: the difference goes back to the balance, or is charged if the actual cost is higher (see Settlement).
What the hold covers:
| Endpoint | Hold |
|---|---|
| Chat | The input counted generously (one token per byte of text, a fixed amount per image depending on the model family, the context window for audio and files) and the output up to max_tokens, or up to the limit the API sets when you don’t give one (see Response length). |
| Images | The maximum price of an image at the requested size (max_credits_per_unit), times the number of images, plus the images you send. |
| Videos | The price of the requested duration with a small margin, plus the first and last frames for models that charge for them. |
| Speech | The price of the text to read. |
| Transcription | The price of the recording’s duration (at least one minute), with a margin. |
| Embeddings | One token per byte of the texts, plus a few tokens per text. |
| OCR | The price of the requested pages. |
Refusals before the call:
| HTTP | code | Case |
|---|---|---|
| 402 | insufficient_credits | The balance does not cover the hold. The body gives required_credits and balance_credits. |
| 402 | spend_cap_exceeded, hold_exceeds_cap | A spend cap does not cover the hold (see Limits). |
| 429 | credits_held_in_progress | The balance would be enough, but your in-flight requests are holding the rest. The body gives held_credits; retry after Retry-After (2 seconds). |
SettlementLink to the Settlement section
For chat (/):
| Situation | What is charged |
|---|---|
| The provider reports the tokens used | Those tokens, at the model’s price. The amount can exceed the hold. |
| The response finished but without a token count | An estimate based on the length of the response, never more than the hold. |
| The provider fails before producing anything | Nothing. |
| The provider fails after it started | The estimate of what was produced. |
| The client leaves before the end, the connection drops, or our timeout is reached | The actual cost the provider reports afterward, when available; otherwise the hold, minus the margin set aside for what cannot be measured. |
For media (images, videos, speech, transcription, embeddings, OCR):
- the request is charged at the actual cost reported by the provider, or at the catalog price for the quantity produced;
- in rare cases, the actual cost exceeds the hold: it is then charged in full, and the balance can drop below zero;
- a request that fails, is refused by the model, or is cut off by our timeout costs nothing;
- an image model that answers with text instead of an image charges for that text;
- OCR charges a fixed price per page read.
Top upLink to the Top up section
The workspace owner or an admin tops up from the portal: “Settings” › “Developer API”, “Billing” tab, “Top up” section (open).
- Pick an amount in “Amount to add”, or “Other amount”. The minimum and maximum are shown below the field.
- The form breaks down the “Credits added”, the “Total credited to your balance”, the “Top-up fee” and the “Total due excl. VAT”. “VAT is added at checkout based on your billing address.”
- “Continue to payment” opens the payment page.
- Your balance is credited as soon as the payment is confirmed, and an email confirms it.
Free creditsLink to the Free credits section
When an offer is running, the form announces it and shows the “Free credits” added to the top-up before you pay. Free credits:
- are not refundable;
- are taken back if the top-up is refunded or disputed;
- are spent after your paid credits.
Refunds and disputesLink to the Refunds and disputes section
If a top-up is refunded or disputed, the credits it brought are taken back (“Reversed after a refund or dispute”), and the balance can go negative. A dispute you win gives them back (“Restored after a dispute”).
Auto top-upLink to the Auto top-up section
The “Auto top-up” section tops up the balance when it drops below a threshold.
| Setting | Purpose |
|---|---|
| “When balance falls below (€)” | The threshold that triggers a top-up. It must be lower than the top-up amount. |
| “Top-up amount (€)” | The amount of each top-up, within the same minimum and maximum as a manual top-up. |
- It uses a card you saved during one of your manual top-ups: “Make a manual top-up first to save a card for auto top-up.”
- “Each automatic top-up is invoiced like a manual one, with service fee and VAT added.”
- It also triggers when a request is refused for lack of balance. A delay between two top-ups and a maximum number per day prevent double charges.
- It turns itself off if the card is declined or requires authentication, after several failures in a row, or if the card is disputed. The owner and the billing contact are notified by email.
- It also stops when the person whose card pays leaves the workspace.
API credit included in a planLink to the API credit included in a plan section
Some paid Moon AI plans include API credit every month; the portal says so (“Monthly API credit included starting with” a given plan) and the pricing page gives the amounts.
- It is added to the workspace wallet at the start of each plan period, as long as the subscription is paid (not during a trial period).
- It does not roll over: the unused part expires at the start of the next period (“Unused plan credit expired”).
- If the workspace moves during the period to a plan that includes more, the difference is added pro rata for the time remaining.
- It is spent before your paid credits, and is never refunded.
Invoices and historyLink to the Invoices and history section
In the portal’s “Billing” tab:
- “Credit history” lists every movement: “Manual top-up”, “Automatic top-up”, “Free credits”, “Plan API credit”, “Credits granted by Moon AI”, “Adjustment by Moon AI”, and amounts taken back after a refund or a dispute;
- “Invoices” gives one invoice per top-up, with its number, the breakdown excluding VAT and the VAT, “View” and “Download invoice”.
Caps and alertsLink to the Caps and alerts section
- Spend caps per hour, per day or over 30 days, for the workspace and for each key, limit what the API can spend: see Limits.
- The workspace owner and billing contact get an email for each top-up and each new key. They also get one when a cap is reached, when a request is refused for lack of balance (at most once every 24 hours), and when auto top-up turns itself off.