---
title: "Generate videos using AI video models"
method: POST
path: "/api/ai/{project_id}/video"
tags: ["AI"]
---

# Generate videos using AI video models

`POST /api/ai/{project_id}/video`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/ai/{project_id}/video`
- Auth: HTTP bearer

**🎬 AI Video Generation**

Generate videos from a text prompt, or animate an existing image.
Runs on the Vercel AI Gateway; the finished MP4 is stored on Blink's own
CDN and returned as a permanent public URL safe to embed in a site.

**Models** are selected by tier, not by raw model ID:
- `fast` (default) — cheapest and quickest, best for background/hero loops
- `better` — higher fidelity, same controls
- `best` — highest quality; noticeably slower, use only when asked for

Audio is **off by default**: web video autoplays muted, and muted
generation is cheaper. Pass `generate_audio: true` to include a track.

Typical latency is 30–60s (`fast`/`better`) and up to ~150s (`best`).

## Path parameters

- `project_id` string, required

## Request body

- object
  - `prompt` string, required: Description of the video, or of the motion to apply to `image_url`
  - `model` 'fast' | 'better' | 'best': Quality tier. Legacy `fal-ai/*` IDs are accepted and mapped to a tier.
  - `image_url` string, uri: Source image to animate (image-to-video). Also accepts a data URI.
  - `duration` string: Clip length in seconds; snapped to the nearest length the model supports.
  - `aspect_ratio` '16:9' | '9:16' | '1:1': Text-to-video only. Ignored when `image_url` is set (output follows the image).
  - `generate_audio` boolean: Include an audio track. Off by default.

## Response `200`

Video generated

- object
  - `result` object
    - `video` object
      - `url` string: Permanent public URL on Blink storage
      - `content_type` string
      - `file_size` integer
      - `duration` number
  - `usage` object
    - `durationSeconds` number
    - `creditsCharged` number
    - `costUSD` number
    - `model` string

## Other responses

- `400`: Validation error
- `401`: Authentication required or invalid API key
- `500`: Internal server error
- `504`: Generation exceeded the server deadline; nothing was charged

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
