> ## Documentation Index
> Fetch the complete documentation index at: https://veogenstudio.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Generation

> Submit a prompt (and optional image) to generate a video or image.

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_TOKEN`
</ParamField>

<ParamField body="model" type="string" required>
  The model slug to use. See [Models](/api-reference/models/list) for all available slugs.

  **Video models:** `grok-video-1`, `veo-3.1-fast`, `sora-2`, `sora-2-pro`, `seedance-2.0`, `seedance-2.0-fast`

  **Image models:** `gpt-4o-image`, `seedream-4.5`, `seedream-5.0-lite`, `nano-banana-pro`, `nano-banana-2`
</ParamField>

<ParamField body="prompt" type="string" required>
  The text prompt describing what to generate. Maximum 2,000 characters.
</ParamField>

<ParamField body="aspect_ratio" type="string">
  The output aspect ratio. Defaults to the model's first supported ratio.

  Common values: `16:9`, `9:16`, `1:1`, `4:3`
</ParamField>

<ParamField body="resolution" type="string">
  Output resolution. Only applicable to models that support multiple resolutions.

  **Video:** `480p`, `720p`, `1080p`, `4k` (model-dependent)

  **Image:** `0.5K`, `1K`, `2K`, `4K` (model-dependent)

  <Note>Resolution multipliers increase the price. A `4k` video on Veo 3.1 Fast costs 3× the base price. Seedance 2.0 720p costs \~2.15× the 480p rate. See [Pricing](https://veogen.studio/pricing).</Note>
</ParamField>

<ParamField body="duration" type="integer">
  Duration in seconds. Only for video models. Accepted values depend on the model:

  * `grok-video-1`: 6–30 seconds (billed per second at \$0.03/s)
  * `sora-2`: 10 or 15 seconds
  * `sora-2-pro`: 10, 15, or 25 seconds
  * `seedance-2.0`: 4–15 seconds (billed per second at $0.132/s for 480p, $0.284/s for 720p)
  * `seedance-2.0-fast`: 4–15 seconds (billed per second at $0.1056/s for 480p, $0.2288/s for 720p)

  <Note>Seedance models have **reduced pricing** when a reference video is provided via `video_urls`. See the [video\_urls](#video_urls) parameter below.</Note>
</ParamField>

<ParamField body="mode" type="string">
  Generation mode. Model-specific:

  * `grok-video-1`: `custom`, `normal`, `fun`, `spicy`
  * `veo-3.1-fast`: `frame` (image-to-video), `ingredient` (reference images)
</ParamField>

<ParamField body="style" type="string">
  Visual style preset. Only for `sora-2` and `sora-2-pro`.

  Values: `none`, `thanksgiving`, `comic`, `news`, `selfie`, `nostalgic`, `anime`
</ParamField>

<ParamField body="image_urls" type="array">
  Array of publicly accessible image URLs to use as input. Maximum count is model-dependent (up to 14 for image models).

  For video models, the **first URL** is used as the first frame. Additional images are treated as reference images.
</ParamField>

<ParamField body="video_urls" type="array">
  Array of publicly accessible video URLs to use as reference input. Up to 3 URLs. **Seedance 2.0 / 2.0 Fast only.**

  When provided, the generation uses the reference video to guide output, and the price is discounted:

  | Model               | 480p                     | 720p                    |
  | ------------------- | ------------------------ | ----------------------- |
  | `seedance-2.0`      | $0.08/s (vs $0.132/s)    | $0.1712/s (vs $0.284/s) |
  | `seedance-2.0-fast` | $0.0632/s (vs $0.1056/s) | $0.136/s (vs $0.2288/s) |

  Supported formats: MP4, WebM, MOV.
</ParamField>

<ParamField body="audio_urls" type="array">
  Array of publicly accessible audio URLs to use as reference input. Up to 3 URLs. **Seedance 2.0 / 2.0 Fast only.**

  Supported formats: MP3, WAV, M4A, OGG.
</ParamField>

<ParamField body="watermark" type="boolean">
  Whether to add a watermark to the output. Defaults to `false`. Only for `sora-2` and `sora-2-pro`.
</ParamField>

<ParamField body="private" type="boolean">
  Whether the generation should be private. Only for `sora-2` and `sora-2-pro`.
</ParamField>

***

## Response `201 Created`

<ResponseField name="data" type="object">
  <Expandable title="Generation object">
    <ResponseField name="id" type="string">UUID of the generation. Use this to poll for status.</ResponseField>
    <ResponseField name="status" type="string">`pending` | `processing` | `completed` | `failed`</ResponseField>
    <ResponseField name="model" type="string">The model slug used.</ResponseField>
    <ResponseField name="type" type="string">`video` | `image`</ResponseField>
    <ResponseField name="prompt" type="string">The prompt submitted.</ResponseField>
    <ResponseField name="parameters" type="object">Resolved parameters (aspect\_ratio, duration, resolution, mode).</ResponseField>

    <ResponseField name="output" type="object | null">
      `null` until `status` is `completed`. Then contains `url` and `content_type`.
    </ResponseField>

    <ResponseField name="error" type="string | null">Error message. Only present when `status` is `failed`.</ResponseField>
    <ResponseField name="created_at" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="completed_at" type="string | null">ISO 8601 timestamp when generation finished.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="price_usd" type="number">
  The exact USD amount charged for this generation.
</ResponseField>

***

## Error Responses

<ResponseField name="402 Insufficient Balance">
  ```json theme={null}
  {
    "error": "Insufficient balance.",
    "message": "This generation costs $0.30. Your balance is $0.05.",
    "required": 0.30,
    "balance": 0.05
  }
  ```

  Top up at [veogen.studio/billing](https://veogen.studio/billing).
</ResponseField>

<ResponseField name="422 Validation Error">
  ```json theme={null}
  {
    "message": "The model field is required.",
    "errors": {
      "model": ["The model field is required."]
    }
  }
  ```
</ResponseField>

***

## Examples

<CodeGroup>
  ```bash Image — GPT-4o theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-4o-image",
      "prompt": "A serene mountain landscape at sunset, photorealistic",
      "aspect_ratio": "16:9"
    }'
  ```

  ```bash Video — Veo 3.1 Fast theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-fast",
      "prompt": "Ocean waves crashing on a rocky shore, dramatic storm clouds",
      "aspect_ratio": "16:9",
      "resolution": "1080p"
    }'
  ```

  ```bash Video — Grok Video (per-second billing) theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "grok-video-1",
      "prompt": "A cat wearing sunglasses skateboarding down a city street",
      "aspect_ratio": "16:9",
      "duration": 10,
      "resolution": "720p",
      "mode": "fun"
    }'
  ```

  ```bash Video — Seedance 2.0 (with audio) theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "seedance-2.0",
      "prompt": "Aerial drone shot over a misty mountain lake at sunrise",
      "aspect_ratio": "21:9",
      "duration": 10,
      "resolution": "720p",
      "generate_audio": true
    }'
  ```

  ```bash Video — Seedance 2.0 Fast theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "seedance-2.0-fast",
      "prompt": "A hummingbird hovering near a tropical flower, macro shot",
      "aspect_ratio": "16:9",
      "duration": 5,
      "resolution": "480p"
    }'
  ```

  ```bash Video-to-Video — Seedance 2.0 (discounted) theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "seedance-2.0",
      "prompt": "Transform the input video into a cinematic slow-motion sequence",
      "duration": 10,
      "resolution": "480p",
      "video_urls": ["https://example.com/reference-video.mp4"]
    }'
  ```

  ```bash Image-to-Video — Veo 3.1 Fast theme={null}
  curl -X POST https://veogen.studio/api/v1/generations \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "veo-3.1-fast",
      "prompt": "Camera slowly zooms out to reveal the full panoramic view",
      "aspect_ratio": "16:9",
      "image_urls": ["https://example.com/landscape.jpg"]
    }'
  ```

  ```python Python theme={null}
  import requests
  import time

  token = "YOUR_TOKEN"
  base_url = "https://veogen.studio/api/v1"
  headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}

  # Submit generation
  res = requests.post(f"{base_url}/generations", headers=headers, json={
      "model": "gpt-4o-image",
      "prompt": "A futuristic cityscape at night",
      "aspect_ratio": "16:9"
  })
  data = res.json()
  gen_id = data["data"]["id"]
  print(f"Submitted: {gen_id} — charged ${data['price_usd']}")

  # Poll until complete
  while True:
      res = requests.get(f"{base_url}/generations/{gen_id}", headers=headers)
      generation = res.json()["data"]
      if generation["status"] == "completed":
          print(f"Done! URL: {generation['output']['url']}")
          break
      elif generation["status"] == "failed":
          print(f"Failed: {generation['error']}")
          break
      time.sleep(3)
  ```

  ```javascript Node.js theme={null}
  const fetch = require("node-fetch");

  const token = "YOUR_TOKEN";
  const baseUrl = "https://veogen.studio/api/v1";
  const headers = {
    Authorization: `Bearer ${token}`,
    "Content-Type": "application/json",
    Accept: "application/json",
  };

  async function generate() {
    const res = await fetch(`${baseUrl}/generations`, {
      method: "POST",
      headers,
      body: JSON.stringify({
        model: "gpt-4o-image",
        prompt: "A futuristic cityscape at night",
        aspect_ratio: "16:9",
      }),
    });
    const { data, price_usd } = await res.json();
    console.log(`Submitted ${data.id} — charged $${price_usd}`);

    // Poll for result
    while (true) {
      await new Promise((r) => setTimeout(r, 3000));
      const poll = await fetch(`${baseUrl}/generations/${data.id}`, { headers });
      const { data: gen } = await poll.json();
      if (gen.status === "completed") {
        console.log("Done!", gen.output.url);
        break;
      }
      if (gen.status === "failed") {
        console.error("Failed:", gen.error);
        break;
      }
    }
  }

  generate();
  ```
</CodeGroup>
