---
title: "Generate an image or a video"
method: POST
path: "/generations"
tags: ["Generations"]
---

# Generate an image or a video

`POST /generations`

## Request

- Base URL: `https://api.cut.pro/api/v1`
- URL: `https://api.cut.pro/api/v1/generations`
- Auth: API key in header `X-Api-Key`

Generates one image or video with the chosen model from `GET /generations/models`, from a prompt alone or from images. Charges the credits at once; poll `GET /generations/{id}` every 10 seconds until it is `ready` or `failed`, which gives them back.

`credits` is the total price the user agreed to: the model's `credits` for the mode and resolution, times `seconds` for a video (`silent_credits` with `audio: false`). A different current price answers `PRICE_CHANGED` with the new total and charges nothing. Always tell the user the model and the price and wait for their yes before calling this.

`image_ids` come from `POST /generations/images` or from the `output.image_id` of a ready image: none for `text`, one for `image`, two (first, last) for `frames`, and up to the model's `max_images` for `references`.

## Request body

- object
  - `kind` 'image' | 'video', required
  - `model` string, required: `id` from `GET /generations/models`.
  - `mode` 'text' | 'image' | 'frames' | 'references', required: `text`: from the prompt alone. `image`: animates one image, the first frame (video only). `frames`: goes from a first to a last image (video only). `references`: borrows a person, product or style from the images, or edits them (image).
  - `resolution` string: One of the model's `resolutions`; the model's default when left out.
  - `prompt` string, required: What to show, in any language.
  - `seconds` union: Required for a video: one of the model's `seconds`.
    - string, integer
    - integer: Required for a video: one of the model's `seconds`.
  - `aspect_ratio` '21:9' | '16:9' | '3:2' | '4:3' | '5:4' | '1:1' | '4:5' | '3:4' | '2:3' | '9:16', required
  - `audio` boolean: `false` leaves the sound out of a video whose model has `audio: optional`.
  - `image_ids` string[]
  - `credits` union, required: Total price the user agreed to.
    - string, integer
    - integer: Total price the user agreed to.

## Response `201`

Response for status 201

- object
  - `id` string, required
  - `status` 'processing', required
  - `credits_charged` number, required: `0` when the charge was waived.

## Other responses

- `400`: Response for status 400
- `402`: Response for status 402
- `404`: Response for status 404
- `409`: Response for status 409
- `429`: Response for status 429
- `502`: Response for status 502

---

[API](https://skmtc.dev/cut/apis/cutpro-api.md) · [All operations](https://skmtc.dev/cut/apis/cutpro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cut/apis/cutpro-api/revisions/89d0bafe529c?raw)
