---
title: "Outpaint a generation to a bigger canvas"
method: POST
path: "/v1/expand"
tags: ["Editing"]
---

# Outpaint a generation to a bigger canvas

`POST /v1/expand`

## Request

- Base URL: `https://nanostudiopro.com/api`
- URL: `https://nanostudiopro.com/api/v1/expand`
- Auth: HTTP bearer

Extends an existing generation's scene beyond its original edges to reach a new aspect ratio — the model re-renders the whole scene bigger and blends the seam itself. Saves as a **new** generation in the source's own project. Costs credits at the output resolution (`generate_*`).

- `extend` restricts which sides grow (default: all four).
- `zoom` below 1 zooms out symmetrically (the subject shrinks, more scene appears).
- The base is `generation_id` **or** `asset_id` (an uploaded image), never both. An asset is only read: the result is a new generation in `project_id` (default: the asset's own project; required when the asset has none).

## Request body

- object
  - `generation_id` string: The base: a generation. Pass this or `asset_id`.
  - `asset_id` string: The base: an uploaded asset. Mutually exclusive with `generation_id`.
  - `project_id` string: `asset_id` only: project for the result. Default: the asset's own project. Ignored for a generation, whose result joins its own project.
  - `target_aspect_ratio` '1:1' | '4:5' | '3:4' | '9:16' | '16:9' | '3:2' | '2:3', required
  - `resolution` '1K' | '2K' | '4K': Default: the source's.
  - `extend` object
    - `left` boolean
    - `right` boolean
    - `top` boolean
    - `bottom` boolean
  - `zoom` number

## Response `200`

Expanded generation with a signed image URL.

## Other responses

- `400`: Missing base or target_aspect_ratio, or invalid fields
- `401`: Missing or invalid token
- `402`: Not enough credits (or token cap exceeded)
- `404`: Generation, asset or project not found
- `429`: Rate limit exceeded
- `503`: Pricing not configured

---

[API](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api.md) · [All operations](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/revisions/b454211e598e?raw)
