Inline Images
How a call carries an image in its body: part of the API guide. Payment is the same on every page: Paying with x402 or Paying with MPP.
Inline images
The image tools take an image inline as well as by URL: a data: URL (data:image/jpeg;base64,…) or bare base64 in the image field. A data: URL in a url field is also read inline, and images-to-pdf takes an images list. This lets an agent pass a photo it already holds without hosting it first. Nothing is fetched for an inline image. It is checked in this order before any decoder sees it:
- the decoded size, computed from the base64 length before anything is decoded (
413past the tool's cap); - the format, read from the image's own first bytes; a
data:type that names a different format, or bytes that are not an image the tool reads, answer415; - the width and height in the file's header, held to the tool's pixel limits before the image is decoded.
PNG and JPEG are read everywhere; some tools also read GIF, BMP, TIFF, WebP or PNM, as each tool's input schema says. On a server that sets HEIC_DECODE=on (off by default), HEIC photos (HEVC-coded, the format phone cameras write by default) are read by the image tools, image-ocr, barcode-decode and images-to-pdf; with it off, a HEIC photo sent to one of them answers 415, asking for the photo as JPEG or PNG, converted on the caller's own device. On a server that takes payment, the proof-of-work tools among them (image-resize, image-convert, image-thumbnail and barcode-decode) decode a HEIC photo on a paid call; a free or proof-of-work call with one answers 415. With the switch on, the file's HEIF boxes are read first, and a declared size past the tool's pixel limits answers 413 and a coding other than HEVC (an AV1-coded HEIF or AVIF file, for one) answers 415, both before anything is decoded. The photo is then decoded in a thread of its own, under a memory ceiling and a deadline (422 past either), into PNG (JPEG for images-to-pdf) for the tool. image-exif reads a HEIC photo's EXIF from the file without decoding it. The wallet-only image tools take a request body of up to 13 MB. The proof-of-work image tools keep the 100 KB request body on their HTTP routes. On the hosted MCP connector, a tool call can carry an inline image of the tool's full size (a message up to 13 MB, made of one long value rather than many small ones). The image is used to answer the call and is not stored.