# How are API and MCP generations paid for?

Source: https://www.mage.space/help/integrations/billing

> API and MCP requests are billed in Gems from your Mage balance. Pricing, automatic refunds, auto top-up, and spending controls.

Every generation made through the Mage API or MCP server is paid in **Gems** from your Mage balance. Memberships and Unlimited apply in the web app only, and your account needs at least one completed purchase (any Gem pack or plan) to unlock API and MCP access.

## Checking costs before generating

Prices depend on model, resolution, duration, and reference count. See rates on [API Models](https://www.mage.space/developers/models). MCP assistants can quote a generation for free before starting, and every API response includes a `billing` field showing the exact charge.

## Charges and automatic refunds

| Outcome | Gems |
| --- | --- |
| Request accepted | Charged |
| Generation failed or blocked by external provider | Refunded automatically |
| Request refused before running (e.g., low balance or 429) | Not charged |
| Cancelled by you, or output blocked by Mage content rules | Not refunded |

## Running out of Gems and auto top-up

If your balance can’t cover a request, it is rejected without charging. If you have [auto top-up](https://www.mage.space/help/gems/auto-top-up) turned on, it tops up your balance automatically for API and MCP requests too. Leave it off if you want spending strictly capped at your current Gems.

Buy Gems on [Gems](https://www.mage.space/gems), or view balances, transactions, and auto top-up under [API → Billing](https://www.mage.space/api).

## Common questions

### Is there a free tier for the API?

No. API and MCP requests run on paid Gems after your first completed purchase. Free sign-up Gems are for the Mage web app.

### How long are API outputs hosted?

Inputs and outputs are retained for 30 days. Copy anything you want to keep to your own storage.
