Text to Video
Generate a video with sound from a prompt alone, in any variant (Veo 3.1 text_to_video).
Veo 3.1 generates a video from a prompt alone, with any variant.
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 | text_to_video |
prompt | string | Yes | What the video shows, 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. |
duration | integer | Yes | Output length in seconds: 4, 6 or 8. 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. |
standard, 1080p, 16:9, 8 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": "standard",
"mode": "text_to_video",
"prompt": "A paper boat drifts down a rainy city street gutter, close-up, soft morning light",
"resolution": "1080p",
"aspect_ratio": "16:9",
"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; sound in the output (generate_audio) doesn'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.