# Errors and rate limits

> See the request limits for brand8's MCP server and brand keys, what to do when you go over, the error codes you can get, and how long media links last.

Source: https://staging.brand8.ai/docs/errors-and-rate-limits

brand8's server limits each key to 60 requests a minute and each IP address to 120 requests a minute before sign-in. A request over a limit is refused. Wait a minute, then retry.

[Diagram: A request travels left to right through four gates. Gate 1 'Address and method: POST only, browser origin must match', Gate 2 'IP limit: 120 requests a minute, before sign-in', Gate 3 'Sign-in: key or personal connection', Gate 4 'Key limit: 60 requests a minute'. After the gates a box 'Tool runs'. Under gates 2 and 4 a red exit arrow labelled 'Refused: retry after a minute'. Under gate 3 an exit arrow labelled '401 or 403'. Warm off-white background, one accent colour.]

## Limits

| Limit | Value |
| --- | --- |
| Requests per key or personal connection | 60 a minute |
| Requests per IP address, before sign-in | 120 a minute |
| Request size | 32 KiB, one MCP message per request |
| Media links | Expire after 15 minutes. Ask for a fresh one |
| Prepared still-ad quote | Expires after 30 minutes |

## When you go over a limit

Space requests out and retry after a minute. If brand8 cannot check the limit at that moment, it also refuses the request rather than letting unmetered traffic through.

> [!TIP]
> Do not retry a 400, 401 or 403 without changing the request.

## Read an error

Address, method, origin and key checks return a JSON body with an `error` message and a stable `code` you can switch on.

```json
{ "error": "API key lacks required scope: brand-context:read", "code": "INSUFFICIENT_SCOPE" }
```

| Status | Code | Meaning and fix |
| --- | --- | --- |
| 401 | `MISSING_API_KEY` | No `Authorization: Bearer` header. Add it |
| 401 | `INVALID_API_KEY` | The key is unknown or revoked, or its organization or brand is no longer active. Make a new key |
| 401 | `INVALID_TOKEN` | A personal connection's token was not accepted. Sign in again |
| 403 | `INSUFFICIENT_SCOPE` | The key lacks the scope: create a key with it. A personal connection is asked for more consent instead |
| 403 | `KEY_NOT_BRAND_SCOPED` | The key is not bound to a brand. Create a new key |
| 403 | `KEY_ISSUER_NOT_AUTHORIZED` | The key's creator is no longer a member of the brand's organization |
| 403 | `ACCESS_DENIED` | A personal connection has no access. Check its consent |
| 403 | `ORIGIN_NOT_ALLOWED` | A browser sent an origin that is not brand8's. Call from a server or CLI |
| 404 | `NOT_FOUND` | The connector is not available yet. A wrong path returns the site's normal 404 page |
| 405 | `METHOD_NOT_ALLOWED` | Only `POST` is served. The response includes `Allow: POST` |
| 429 | | Over a limit. Wait a minute, then retry |
| 500 | `INTERNAL_ERROR` | Try again later |

A few responses carry only an `error` message and no `code`: a body over 32 KiB (413) and a batch of messages (400). Send one message per request.

A message that breaks the MCP protocol returns a JSON-RPC error with the generic text "MCP request rejected": 400 for malformed JSON, 406 if `Accept` does not list both `application/json` and `text/event-stream`, and 415 if `Content-Type` is not `application/json`.

When a key or token is rejected, the response includes an `X-Motion-Request-Id` header. Quote it when you contact brand8.

## Read a tool error

A creative, image or personal-connection tool that fails returns a normal MCP result with `isError` set and one fixed code. The text is never copied from your input. A read tool for evidence, Cast or Assets returns `isError` with a generic message and no code: check the input and search again.

| Code | Meaning |
| --- | --- |
| `INVALID_INPUT` | A field is missing or wrong. Fix it and retry |
| `FORBIDDEN` | This connection or its owner cannot do that for this brand |
| `NOT_FOUND` | Use a list tool to find a current handle. For a request, the answer names its id and kind; on a personal connection with the Brand media and Prepare creative permissions, `get_brand_workspace` lists the brand's ten most recent requests |
| `REQUEST_CONFLICT` | The `request_key` was already used for a different request. Use a new one |
| `STALE` | The template, product or price changed since the quote. Prepare a new request |
| `EXPIRED` | The quote expired. Prepare a new request |
| `INSUFFICIENT_CREDITS` | Not enough credits. Add credits in brand8. Model and quality do not change |
| `POLICY_LIMIT`, `DAILY_LIMIT` | A saved spending limit blocked the request. Do not split it to get around the limit |
| `PREPARATION_FAILED` | The image or ad could not be prepared, and nothing was charged. `reason` says why and the text gives the next step. When present, `field` names what is at fault (a setting, the brief, the references, the products or their photos, the model, the logo choice, or a still ad's template, colour or aspect ratio) and `id` the photo or reference. `temporary` is a brand8 problem: try the same request again, or, when it says so, once more and then stop |
| `SUBMISSION_FAILED` | The ad could not start. Check its status before you try again |
| `UNAVAILABLE` | Creative requests are not available right now |
| `MEDIA_UNAVAILABLE` | A media link could not be created. Ask again |

Responses are never cached: they carry `Cache-Control: private, no-store`.

## FAQ

<details>
<summary>Why do I get a 403 from a browser but not from curl?</summary>

A browser sends an `Origin` header, and brand8 accepts only its own. A server or CLI sends none and is allowed.

</details>

<details>
<summary>Why does GET return 405?</summary>

The server answers `POST` only. It has no event stream and no sessions.

</details>

<details>
<summary>Is the 60 a minute limit per person or per key?</summary>

Per key for a brand key, and per connection for a personal sign-in.

</details>

## Related

- [Developers overview](https://staging.brand8.ai/docs/developers-overview)
- [Connect an AI assistant](https://staging.brand8.ai/docs/connect-an-ai-assistant)
- [API keys and scopes](https://staging.brand8.ai/docs/api-keys-and-scopes)
