> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rainbrand.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Credits and limits

> Plan your Rainbrand API integration with request limits, shared credit usage and generation budgets. Learn how reservations, retries and billing errors work.

REST and MCP use the same account credits. Limits apply at different levels: API-key requests, brand onboarding, and unfinished AI Gateway generations.

## Rate limits

### API-key requests

Each API key has a default limit of **120 accepted requests per minute**. The count resets at the start of each UTC minute, even during steady traffic. Requests rejected by this limit do not delay the reset. A fixed window can allow bursts on either side of a minute boundary.

REST and MCP requests using the same key count toward the same limit, whether you send the key in `x-api-key` or `Authorization: Bearer`. OAuth tokens are not subject to this API-key limit.

When you reach the limit, requests return HTTP `429`. Wait for the number of seconds in the `Retry-After` response header before retrying. If the header is missing, wait 60 seconds. REST uses code `TOO_MANY_REQUESTS`; MCP uses `rate_limit_exceeded`.

If request-limit verification is temporarily unavailable, ordinary API keys continue to work. Integrations with a strict quota arranged with Rainbrand receive HTTP `503` before the operation starts. REST uses `SERVICE_UNAVAILABLE`; MCP uses `service_unavailable`. Wait for `Retry-After`, then retry the same request and idempotency key.

REST responses to API-key requests include a policy header. For the default quota:

```http theme={"dark"}
RateLimit-Policy: "api-key";q=120;w=60
```

`q` is the key's request limit. `w` is the fixed window's length in seconds. This header does not report remaining requests or a reset timestamp. Invalid keys and unmatched routes can receive the default policy; requests without credentials, OAuth requests, and the public specification omit it.

For a higher request quota, [contact support][rainbrand-support].

### Brand onboarding

Each personal account or team can start **5 new brand onboardings in a rolling 60-second window**, shared across members, API keys, and OAuth tokens using REST or MCP. Replaying an accepted idempotent request and reading progress do not consume this onboarding budget. The API-key request limit applies separately.

At this limit, REST returns `TOO_MANY_REQUESTS` with `Retry-After`; MCP returns `RATE_LIMITED` with `retry_after_seconds`. Wait for the returned delay.

### AI Gateway generation

An account without an active paid plan or positive purchased credits can have **3 unfinished billed generations** at once. A paid plan granted at no charge also removes this limit.

A further REST request returns `ACTIVE_GENERATION_LIMIT_REACHED` with the oldest unfinished generation's ID and a pricing link. MCP returns the same guidance in a tool error. Wait for a generation to finish or fail before starting another, or upgrade. An unfinished generation stops occupying its slot after two hours.

## Credits

Use [Get credit balance](https://docs.rainbrand.com/api-reference/account/get-credit-balance.md) to read the balance and `credit_costs` for the personal account or team you are using. Those returned costs account for legacy pricing. [List workspaces](https://docs.rainbrand.com/api-reference/account/list-workspaces.md) identifies the teams you can access.

Current plans, credit allowances, and top-up options are on [Pricing](https://www.rainbrand.com/pricing). Plan credits renew monthly on the billing anniversary and do not roll over. Purchased top-up credits do not expire.

### AI Gateway billing

Any positive, usable credits with a known value can fund a billed generation, including signup credits. Before starting, Rainbrand reserves the estimated charge plus a **10% buffer**. The account needs enough available credits for that reservation and no outstanding debt.

After completion, Rainbrand settles the actual charge and returns unused reserved credits. If the charge exceeds the reservation, remaining credits cover the difference; an unpaid amount becomes debt. Failed or unusable output is not charged. Reservations left by interrupted jobs expire within four hours.

Completed output remains available while billing retries in the background. Models that are not billed can run without a charge.

### Billing errors

Use `error.code` to decide what to do. The HTTP status alone is not enough.

| Code | What to do |
| - | - |
| `INSUFFICIENT_CREDITS` (`402`) | Follow `data.action_url` to add credits, upgrade, or settle debt. |
| `PAYMENT_REQUIRED` (`402`) | The subscription is paused. Follow `data.action_url` to resolve payment. |
| `BILLING_TEMPORARILY_UNAVAILABLE` (`503`) | No generation started. Wait for `Retry-After`, then retry the same request and idempotency key. |
| `BILLING_CONFIRMATION_PENDING` (`409`) | No generation started, but a temporary reservation may remain. Do not resubmit automatically; check the balance first. |
| `BILLING_SETUP_ERROR` (`500`) | Nothing ran or was charged. Contact support; retrying does not resolve it. |

MCP returns the corresponding guidance in tool errors. If a credit balance read says the billing account is not set up, contact [support][rainbrand-support] with the billing ID in the message.

[rainbrand-support]: mailto:support@rainbrand.com


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.