Skip to main content
POST
/
images
/
resize
Reframe a prior generation to a new aspect ratio
curl --request POST \
  --url http://localhost:3001/api/v1/images/resize \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "imageId": "3f9a4c2e-7b1d-4e8a-9c3f-2a1b0c9d8e7f",
  "aspectRatio": "16:9"
}
'
{
  "data": {
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "result": {
      "images": [
        {
          "id": "<string>",
          "url": "<string>",
          "width": 0,
          "height": 0
        }
      ],
      "video": {
        "id": "<string>",
        "url": "<string>",
        "durationSeconds": 0,
        "thumbnailUrl": "<string>",
        "width": 0,
        "height": 0
      },
      "style": {
        "id": "<string>"
      }
    },
    "error": {
      "message": "<string>"
    }
  }
}

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Optional unique key (≤255 chars) that makes this create idempotent: a retry with the same key returns the original job rather than starting a new one. Scoped to your API key; retained ~24h.

Maximum string length: 255

Body

application/json
imageId
string<uuid>
required

The id of a prior generation (job) to edit, resize, or upscale.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
aspectRatio
enum<string>
required
Available options:
1:1,
1:4,
1:8,
2:3,
3:2,
3:4,
4:1,
4:3,
4:5,
5:4,
8:1,
9:16,
16:9,
21:9
resolution
enum<string>

Output resolution. Higher resolutions cost more credits.

Available options:
1K,
2K,
4K

Response

Accepted

data
object
required