media

Extend one image past its own borders onto a larger canvas (metered provider call).

The two argument surfaces and every refusal they carry are resolved inside the runner, against the source Moda measured — so the 422s here are the same ones the agent and the connector get, worded once. That includes the model's output ceiling, which the per-side cap does not imply.

The response carries applied: the effective mode, the requested aspect ratio, the resolved four-side expansion, the source's dimensions, the canvas those expansions add up to, and the dimensions actually delivered.

post/media/outpaint

Request

  • Base URL
    https://api.moda.app/v1
  • URL
    https://api.moda.app/v1/media/outpaint
  • Auth
    HTTP bearer

Headers

Moda-Version'2026-04-12' | '2026-05-01'
Example: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.

Request body

imagestring 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_ratiostring nullable

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_topinteger nullable

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_bottominteger nullable

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_leftinteger nullable

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_rightinteger nullable

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.

modestring nullable

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

idempotency_keystring nullable

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

Response

Successful Response

object required

Changes