Skip to main content
POST
Outpaint Image

Authorizations

Authorization
string
header
required

API key from Settings > Developer > REST API

Headers

Moda-Version
enum<string>
default:2026-05-01

Calendar-dated API version pin. New integrations should pin 2026-05-01 to opt into the newest response shapes. For back-compat the server also accepts requests with no header and resolves them to the current default (today: 2026-04-12); that default advances on each sunset date. Any unsupported value returns 400 unsupported_version.

Available options:
2026-04-12,
2026-05-01
Example:

"2026-05-01"

Body

application/json
image
string
required

file_ id of an image Moda has measured. This verb's price counts the source AND the rendered canvas together, so an unmeasured http(s) URL is rejected — and a bigger source costs more even for a small expansion.

aspect_ratio
string | null

Target shape, one of 1:1, 21:9, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5. The four expansions are computed for you and split evenly on whichever axis is short. Rejected for a ratio the image already has — that would expand nothing while still billing a render. Mutually exclusive with the expand_* values. The expanded canvas must also stay within 4MP (4,194,304 pixels), which the per-side cap does not imply — a request past it is rejected naming the size, never resized down, and a source already at or past it must be downscaled before it can be outpainted at all.

expand_top
integer | null

Pixels to add on this side, 0 to 2048. Supply one or more of the four for precise control ('extend the sky upward'); mutually exclusive with aspect_ratio, and supplying both is rejected rather than silently honouring one. An all-zero request is rejected: it would bill a full render for a copy of the input. The expanded canvas must also stay within 4MP (4,194,304 pixels), which the per-side cap does not imply — a request past it is rejected naming the size, never resized down, and a source already at or past it must be downscaled before it can be outpainted at all.

expand_bottom
integer | null

Pixels to add on this side, 0 to 2048. Supply one or more of the four for precise control ('extend the sky upward'); mutually exclusive with aspect_ratio, and supplying both is rejected rather than silently honouring one. An all-zero request is rejected: it would bill a full render for a copy of the input. The expanded canvas must also stay within 4MP (4,194,304 pixels), which the per-side cap does not imply — a request past it is rejected naming the size, never resized down, and a source already at or past it must be downscaled before it can be outpainted at all.

expand_left
integer | null

Pixels to add on this side, 0 to 2048. Supply one or more of the four for precise control ('extend the sky upward'); mutually exclusive with aspect_ratio, and supplying both is rejected rather than silently honouring one. An all-zero request is rejected: it would bill a full render for a copy of the input. The expanded canvas must also stay within 4MP (4,194,304 pixels), which the per-side cap does not imply — a request past it is rejected naming the size, never resized down, and a source already at or past it must be downscaled before it can be outpainted at all.

expand_right
integer | null

Pixels to add on this side, 0 to 2048. Supply one or more of the four for precise control ('extend the sky upward'); mutually exclusive with aspect_ratio, and supplying both is rejected rather than silently honouring one. An all-zero request is rejected: it would bill a full render for a copy of the input. The expanded canvas must also stay within 4MP (4,194,304 pixels), which the per-side cap does not imply — a request past it is rejected naming the size, never resized down, and a source already at or past it must be downscaled before it can be outpainted at all.

mode
string | null

high or fast (default high). fast trades fidelity for speed at the same price.

idempotency_key
string | null

A retried call with the same key replays the stored response (replayed:true) instead of paying for a second provider render.

Maximum string length: 200

Response

Successful Response

The response is of type Response Mediaoutpaintimage · object.