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

# Invalid Run Payload

> The run payload has an empty user message, a block that is neither text nor an image, or images over the limits.

**HTTP status:** 400

## Error message

The message lists every problem in the payload, separated by `; `. Each problem is one of:

```text theme={null}
a user message needs at least one text or image block
```

```text theme={null}
{location}: only text and image blocks are accepted
```

```text theme={null}
{location}: image is {bytes} bytes once decoded, over the 524288-byte limit
```

```text theme={null}
the images sent with one run total {bytes} bytes once decoded, over the 524288-byte limit
```

```text theme={null}
at most 20 images may be sent with one run; these are {count}
```

`{location}` names the block: `content[1]` for a block in a user message, `outputs[0].content[2]` for the third
block of the first tool output.

For example, a user message whose `content[0]` is a `tool_use` block and whose `content[1]` is a 600,000-byte image
reports three problems. The image is over the per-image limit, and with it the payload is over the total:

```text theme={null}
content[0]: only text and image blocks are accepted; content[1]: image is 600000 bytes once decoded, over the 524288-byte limit; the images sent with one run total 600000 bytes once decoded, over the 524288-byte limit
```

## When this error occurs

`POST /agents/conversations/{id}/runs` checks the blocks in its `payload` before it starts the run, in the user
message and in each tool output's `content`:

| Rule | Limit |
| - | - |
| Blocks in a `user_message` | at least one. A plain string, including an empty one, counts as one text block |
| Block types | `text` and `image` only |
| One image, decoded | at most 524,288 bytes (512 KB) |
| All images in one run's payload, decoded | at most 524,288 bytes in total |
| Images in one run's payload | at most 20 |

The platform writes `tool_use`, `tool_result` and `reasoning` blocks itself, so a payload that includes one gets this
error.

A body that doesn't decode at all is a different 400, with an `{error, error_description}` body. This covers an
unknown block `type`, and an image with any of these:

* a `media_type` other than `image/jpeg`, `image/png`, `image/gif` or `image/webp`;
* a `source` whose `type` isn't `base64`, such as a URL;
* `data` that isn't valid base64. Send the raw image bytes base64-encoded with the standard alphabet. Don't send a
  data URL (`data:image/png;base64,...`); send only the part after the comma.

## How to fix

The error lists every problem at once, so fix them all before you send the run again.

* **Empty user message.** Send at least one `text` or `image` block, or send `text` as a string.
* **A block other than text or an image.** Keep only `text` and `image` blocks in `content`. To return structured
  data from a client tool, serialize it to a string and send it as text.
* **An image over 512 KB.** Downscale or recompress the image before you send it. A JPEG or WebP is usually much
  smaller than a PNG of the same picture.
* **Over the total, or more than 20 images.** Send fewer images per run, and the rest with the next run. A run
  carries at most 1 MB of images, counting earlier turns and what MCP tools return. Past that, the model sees the
  newest images that fit and a short note in place of each older one.


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