Image to Video
Generate a video with sound that starts from a first frame, and with lite can end on a last frame (Veo 3.1 image_to_video).
Veo 3.1 starts the video from the first image in image_urls; prompt says what happens next. With the lite variant it can also end on a last frame.
variant | image_urls | aspect_ratio | duration |
|---|---|---|---|
standard, fast | 1 image: the first frame | 16:9 or 9:16 | 4, 6 or 8 |
lite | 1–2 images: the first frame, then optionally the last frame | 16:9, 9:16 or auto (follows the first frame) | 4, 6 or 8; 8 with a last frame |
Pick the aspect_ratio that matches the first frame: 16:9 for a landscape image, 9:16 for a portrait one (or auto with lite).
Create a task
https://api.nanoapi.ai/v1/tasksUse the shared create endpoint with model: "veo-3.1".
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <API key>, see Authentication. |
Content-Type | Yes | application/json |
Idempotency-Key | No | A unique string for every new task, ideally a UUID (1–255 characters). See Preventing duplicate tasks. |
Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | veo-3.1 |
variant | string | Yes | standard, fast or lite, see Variants. Sets the price. |
mode | string | Yes | image_to_video |
image_urls | string[] | Yes | The first frame; lite can add a last frame as the second image (see the table above). See Media. |
prompt | string | Yes | What happens in the video, at most 8000 characters. Best written in English. |
resolution | string | Yes | standard and fast: 720p, 1080p or 4k. lite: 720p. Sets the price. |
aspect_ratio | string | Yes | 16:9 or 9:16; lite also takes auto, which follows the first frame. |
duration | integer | Yes | Output length in seconds: 4, 6 or 8 (8 when lite has a last frame). Billed per second, see Pricing. |
generate_audio | boolean | No | lite only: whether the output has sound, default true. Doesn't affect the price. standard and fast always have sound, and sending it with them returns 400 invalid_request. |
webhook_url | string | No | Notified when the task succeeds or fails: https, up to 2048 characters, not a private, loopback or reserved address. See Webhooks. |
fast, first frame only, 1080p, 4 seconds:
curl https://api.nanoapi.ai/v1/tasks \
-H "Authorization: Bearer $NANOAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1",
"variant": "fast",
"mode": "image_to_video",
"image_urls": ["https://example.com/first_frame.jpg"],
"prompt": "The cat slowly turns its head, looks at the camera and meows, the camera slowly pushes in",
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 4
}'lite with a first and a last frame (so duration is 8), aspect ratio following the first frame:
curl https://api.nanoapi.ai/v1/tasks \
-H "Authorization: Bearer $NANOAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1",
"variant": "lite",
"mode": "image_to_video",
"image_urls": [
"https://example.com/first_frame.jpg",
"https://example.com/last_frame.jpg"
],
"prompt": "The camera slowly orbits around the cat sitting on the car hood",
"resolution": "720p",
"aspect_ratio": "auto",
"duration": 8
}'Response: 200 OK, the new task (fields). Keep data.id to get the result; the task can still fail, see Errors.
{
"code": 200,
"message": "success",
"data": {
"object": "task",
"id": "tk_01jbq3v6n9c2x5b8m1q4w7e0r3",
"model": "veo-3.1",
"status": "queued",
"error": null,
"created_at": "2026-11-11T08:30:00Z"
}
}Pricing
cost = duration × price per second of the variant and resolutionLoading the current prices…
Billed seconds are the duration you ask for; the images and sound in the output (generate_audio) don't change the price. Current prices: GET /v1/products (the prices rows of the variant). The task's billing.frozen is the amount that counts; freezing and charging: Billing. Every variant's prices: Veo 3.1 → Pricing.
Errors
See Veo 3.1 → Errors. This mode's parameter rules are in the table above.