> For the complete documentation index, see [llms.txt](https://monkey-gun.gitbook.io/monkeygun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monkey-gun.gitbook.io/monkeygun/reference/errors.md).

# Errors

Every error is JSON with an error string. The HTTP status is derived from it.

```json
{ "error": "insufficient_credits: this needs 160 credits, wallet has 40 (short 120). Tell them to add a card (it tops up $10 at a time, only when they run short) or buy credits in Settings → Credits." }
```

| Status | When                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Bad arguments. The `error` string says which                                                                                                                                                                                                                                                                                                                                                                                              |
| `401`  | Missing, revoked or wrong key. `{ "error": "unauthorized", "message": "Pass an API key…" }`                                                                                                                                                                                                                                                                                                                                               |
| `402`  | `insufficient_credits: …` names the shortfall: the wallet is short and there is no card on file (or pay-as-you-go is off). `payment_failed (card_declined \| authentication_required \| daily_cap): …` means pay-as-you-go tried and could not top up. Nothing was made or charged. Update the card in Settings → Credits. See [Card on file and pay-as-you-go](/monkeygun/concepts/credits-and-quotes.md#card-on-file-and-pay-as-you-go) |
| `404`  | Unknown tool, video, job or asset; another account's job                                                                                                                                                                                                                                                                                                                                                                                  |
| `413`  | Upload over 250 MB                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `422`  | Upload URL could not be fetched or had no media                                                                                                                                                                                                                                                                                                                                                                                           |

Errors inside a creation that do not abort it (a clip that failed, an image that could not be fetched) are logged, the paid step is refunded, and the video renders without that element. `warnings` on the render response and the rendered webhook list quality-check findings.

## Common causes

| Symptom                                                            | Cause                                                                         | Fix                                                                        |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `Video creation failed (The operation was aborted due to timeout)` | The director exceeded its 150 s cap on a long brief or fast pacing            | Shorten the brief, use `pacing: "standard"`, or send your own `script`     |
| Media URL answers 401                                              | You used the relative `video` path, or the bare media path on a private video | Use `renderUrl` / `url`, or set `public: true`                             |
| Clip scene came back as a still                                    | Image-to-video rejected the seed                                              | Fixed for small logos; for other images make sure they are at least 300 px |
| Webhook never arrived                                              | One attempt, no retry                                                         | Check `GET /v1/webhooks/{id}/deliveries`, run the reconciler               |
| Charge higher than the quote                                       | Show defaults or `images: "auto"` generated images                            | Pass `images` explicitly, omit `showId` when you want the quote exactly    |
| Video has the wrong brand or a frame                               | `channelId` applied the channel lock                                          | Omit `channelId`, or pass `brand` and omit `showId`                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://monkey-gun.gitbook.io/monkeygun/reference/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
