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

# Create video generation

> POST /v1/videos/generations — submit an async video generation job.

Video generation is **asynchronous**. Submit → receive `job_id` → poll the [status endpoint](/api-reference/videos/status) until complete.

## Submit a job

```bash theme={null}
curl https://api.infery.ai/v1/videos/generations \
  -H "Authorization: Bearer $INFERY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo-3-1-fast",
    "prompt": "A cat surfing on a banana at sunset, cinematic",
    "duration_seconds": 4,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }'
```

Response:

```json theme={null}
{
  "job_id": "vgen_...",
  "status": "queued",
  "created_at": 1713204900,
  "model": "veo-3-1-fast"
}
```

## Image-to-video

Pass a reference image via `image_url` or `image_base64`:

```json theme={null}
{
  "model": "veo-3-1-fast",
  "prompt": "Animate this photo with gentle camera pan",
  "image_base64": "<base64 of source image>"
}
```

## Supported models

Google Veo (3 and 2), OpenAI Sora, xAI (Grok Video), Alibaba Wan. See [Models catalog](/models/catalog).

## Storage

Completed videos are **auto-mirrored to GCS** — the returned `url` is signed and persists past the upstream provider's ephemeral URLs. To reference a generated video later, use our `GET /v1/files/:id/content` pattern or keep the signed URL.


## OpenAPI

````yaml openapi.json POST /v1/videos/generations
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - Video
      summary: Create video generation
      operationId: createVideoGeneration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  description: Model ID to use for generation
                prompt:
                  type: string
                  description: Text prompt describing the video to generate
                duration:
                  type: number
                  description: Duration in seconds (model-specific, see /v1/models)
                resolution:
                  type: string
                  description: Video resolution (model-specific, see /v1/models)
                aspect_ratio:
                  type: string
                  description: Video aspect ratio (model-specific, see /v1/models)
                'n':
                  type: integer
                  description: Number of videos to generate
                  default: 1
                image_url:
                  type: string
                  description: Reference image URL for image-to-video
                person_generation:
                  type: string
                  enum:
                    - dont_allow
                    - allow_adult
                    - allow_all
                  default: allow_all
                  description: Person generation policy (Google Veo models)
      responses:
        '200':
          description: >-
            Video generation job submitted. Poll `GET
            /v1/videos/generations/{jobId}` until `status === "succeeded"`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: vgen_01HYJ8F3K9QT2X5Z7N1V6W3B4R
                    description: Job ID to poll for status
                  status:
                    type: string
                    enum:
                      - queued
                      - processing
                      - succeeded
                      - failed
                    example: queued
                  progress:
                    type: integer
                    example: 0
                    description: Progress percentage (0-100)
                  created:
                    type: integer
                    example: 1713204900
                  model:
                    type: string
                    example: veo-3-1-fast
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    ErrorResponseDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: object
          example: model_not_found
          nullable: true
          description: Stable machine-readable error code
        param:
          type: object
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error, if
            applicable
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````