{"slug": "how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api", "title": "How to Generate AI Video with Veo 3.1 via the Google Flow API", "summary": "Useapi.net has launched a third-party Google Flow API that enables developers to generate AI video with Veo 3.1 via a single curl command. The service uses a flat subscription model instead of per-second billing, offering significant cost savings compared to the official Gemini API. Developers can choose from multiple Veo models and image generation tools, with pricing starting at $15 per month.", "body_md": "** Veo 3.1, Google's flagship video model, runs from a single curl through useapi.net.** You drive your own\n\nThe official Gemini API and Vertex meter Veo per second of output. This third-party [Google Flow API](https://useapi.net/docs/api-google-flow-v1) runs on a flat [subscription](https://useapi.net/docs/subscription) instead — you spend your normal Flow credits plus one monthly fee for API access, far cheaper per clip. Below: the models you get, the price gap versus the official API, then the two-call workflow and a runnable batch script.\n\nPick a model per request with the `model`\n\nfield (default `veo-3.1-fast`\n\n). Credit costs come from Google's [official Flow credits table](https://support.google.com/flow/answer/16526234):\n\n| Model id | Tier / speed | Durations | Credits per generation |\n|---|---|---|---|\n`veo-3.1-lite` |\nCheapest Veo | 4s, 6s, 8s | 10 (Non-Ultra) · 5 (Ultra) |\n`veo-3.1-lite-low-priority` |\nLite, lower priority | 4s, 6s, 8s | 0 — Ultra $199 only |\n`veo-3.1-fast` (default)\n|\nFast Veo | 4s, 6s, 8s | 20 (Non-Ultra) · 10 (Ultra) |\n`veo-3.1-quality` |\nHighest-quality Veo | 8s only | 100 |\n`omni-flash` |\nGemini Omni Flash, audio-native | 4s, 6s, 8s, 10s | 15 / 20 / 25 / 30 (by length) |\n\nNotes from the [overview](https://useapi.net/docs/api-google-flow-v1): `4s`\n\n/`6s`\n\nare Ultra-only on Veo, `veo-3.1-quality`\n\nis `8s`\n\nonly, `veo-3.1-lite-low-priority`\n\ncosts 0 credits but is available only to Google AI Ultra $199 subscribers, and `10s`\n\nclips are `omni-flash`\n\nonly. Google Flow can also generate stills with Imagen 4 and the Nano Banana models via the separate [POST /images](https://useapi.net/docs/api-google-flow-v1/post-google-flow-images) endpoint.\n\nYou spend your Google AI plan's Flow credits as usual, plus a flat [$15/month](https://useapi.net/docs/subscription) to useapi.net for API access to every supported service — no per-call surcharge.\n\nThird-party [Google Flow API](https://useapi.net/docs/api-google-flow-v1) by [useapi.net](https://useapi.net/) vs. the official [Gemini API](https://ai.google.dev/gemini-api/docs/pricing) — drive your own Google Flow subscription instead of metered, per-call API billing:\n\n| Model | Official Gemini API | useapi.net (Flow Pro) | useapi.net (Flow Ultra) |\n|---|---|---|---|\n| Veo 3.1 Fast — 8s clip | $0.80 | ~$0.40 | ~$0.10 |\n| Veo 3.1 Quality — 8s clip | $3.20 | ~$2.00 | ~$1.00 |\n| Veo 3.1 Lite — 8s clip | $0.40 | ~$0.20 | ~$0.05 |\n| Veo 3.1 Lite, lower priority | — | — | $0 (Ultra $199)\n|\n| Gemini Omni Flash — 8s clip | — (Flow only)\n|\n~$0.50 | ~$0.25 |\n| Nano Banana Pro — per image | $0.134 | included | included |\n| Nano Banana — per image | $0.039 | included | included |\n| Imagen 4 — per image | metered | included | included |\n\nExpected daily output — Ultra ($199/mo) plan. Daily averages observed on top real accounts. These are expected, not guaranteed: Google governs the underlying Flow allowances and they vary with demand.\n\n| Free workload (no Flow credits spent) | Avg generations / day* |\n|---|---|\n| Veo 3.1 Lite — lower priority video | ~1,000 |\n| Images — Nano Banana, Nano Banana Pro, Imagen 4 | up to ~500 |\n\n*Averages from the busiest real accounts — not guarantees. They are set by Google's own allowances and fluctuate with demand. Applies only to the free lower-priority video queue and image generation. Credit-metered models (Veo 3.1 Fast / Quality and Gemini Omni Flash) are not shown here — their volume is bounded by your plan's monthly Flow credits (see the [credit table](https://useapi.net/docs/api-google-flow-v1)), not a free allowance.\n\nVeo is billed per second on the Gemini API (an 8-second 720p clip shown) and images are priced per image. Through useapi.net you spend your own Flow plan credits and pay a flat [$15/month](https://useapi.net/docs/subscription) — image generation is included on any Google AI plan, and there is no Google Cloud project, API key, or per-call metering.\n\nFull per-tier credit allowances and the per-model cost breakdown live on the [Google Flow overview](https://useapi.net/docs/api-google-flow-v1). See the [setup guide](https://useapi.net/docs/start-here/setup-google-flow) to connect your account.\n\nYou need a useapi.net [API token](https://useapi.net/docs/start-here/setup-useapi) and a connected [Google Flow account](https://useapi.net/docs/start-here/setup-google-flow). Generation is asynchronous: pass `async: true`\n\nand the create call returns a `jobid`\n\nimmediately, then you poll until the video is ready.\n\n`POST https://api.useapi.net/v1/google-flow/videos`\n\n:\n\n```\ncurl -X POST \"https://api.useapi.net/v1/google-flow/videos\" \\\n  -H \"Authorization: Bearer $USEAPI_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"A serene mountain landscape at sunset, camera slowly panning right\",\n    \"model\": \"veo-3.1-fast\",\n    \"aspectRatio\": \"landscape\",\n    \"duration\": 8,\n    \"async\": true\n  }'\n```\n\nIn async mode the response returns immediately with `201 Created`\n\n, a lowercase `jobid`\n\n, and `status: \"created\"`\n\n:\n\n```\n{\n  \"jobid\": \"j1731859234567v-u12345-email:jo***@gmail.com-bot:google-flow\",\n  \"type\": \"video\",\n  \"status\": \"created\",\n  \"created\": \"2026-06-15T12:34:56.789Z\",\n  \"request\": {\n    \"async\": true,\n    \"prompt\": \"A serene mountain landscape at sunset, camera slowly panning right\",\n    \"model\": \"veo-3.1-fast\",\n    \"aspectRatio\": \"landscape\",\n    \"duration\": 8\n  }\n}\n```\n\n`GET https://api.useapi.net/v1/google-flow/jobs/{jobId}`\n\n:\n\n```\ncurl \"https://api.useapi.net/v1/google-flow/jobs/{jobId}\" \\\n  -H \"Authorization: Bearer $USEAPI_TOKEN\"\n```\n\n`status`\n\nmoves through `created`\n\n→ `started`\n\n→ `completed`\n\n. When it reaches `completed`\n\n, the finished MP4 is in `response.media[].videoUrl`\n\n(a single prompt with `count > 1`\n\nreturns one entry per clip):\n\n```\n{\n  \"jobid\": \"j1731859234567v-...\",\n  \"type\": \"video\",\n  \"status\": \"completed\",\n  \"response\": {\n    \"media\": [\n      {\n        \"mediaGenerationId\": \"user:12345-email:6a6f...-video:a1d95d21-...\",\n        \"videoUrl\": \"https://flow-content.google/video/a1d95d21-...?Expires=...\",\n        \"thumbnailUrl\": \"https://flow-content.google/image/a1d95d21-...?Expires=...\"\n      }\n    ],\n    \"remainingCredits\": 18760\n  }\n}\n```\n\nVeo 3.1 typically finishes in 60–180 seconds depending on model and mode. The signed `videoUrl`\n\nis valid for about 24 hours, so download promptly. Prefer not to poll? Pass a `replyUrl`\n\nin the create body to receive a webhook callback when the job completes.\n\nVeo takes image inputs two different ways. Upload each image first with [POST /assets/ email](https://useapi.net/docs/api-google-flow-v1/post-google-flow-assets-email) (raw bytes, an image\n\n`Content-Type`\n\n, PNG/JPEG/WebP up to 20 MB). The upload response nests the id at `mediaGenerationId.mediaGenerationId`\n\n— that nested string is what you pass back. When you supply any image input you can omit `email`\n\n: the request routes to the account where the image was uploaded.Your image becomes a literal frame of the clip. Pass it as `startImage`\n\nto start from that frame:\n\n```\ncurl -X POST \"https://api.useapi.net/v1/google-flow/videos\" \\\n  -H \"Authorization: Bearer $USEAPI_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"Brave Captain Cat chasing away the pirates!\",\n    \"model\": \"veo-3.1-fast\",\n    \"aspectRatio\": \"portrait\",\n    \"startImage\": \"user:12345-email:6a6f...-image:ff9aa5cc-...\",\n    \"async\": true\n  }'\n```\n\nAdd `endImage`\n\n(a second uploaded reference id) to pin the last frame so Veo generates the transition between the two. `endImage`\n\nrequires `startImage`\n\n— end-frame-only is not supported. On `omni-flash`\n\n, only `startImage`\n\nis accepted.\n\nYour images guide the whole clip — subject, character, or style — rather than a specific frame. Pass `referenceImage_1`\n\nthrough `referenceImage_3`\n\n(Veo accepts up to 3, on 8-second clips only, and not on `veo-3.1-quality`\n\n). R2V cannot be combined with `startImage`\n\n/`endImage`\n\n:\n\n```\ncurl -X POST \"https://api.useapi.net/v1/google-flow/videos\" \\\n  -H \"Authorization: Bearer $USEAPI_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"prompt\": \"A lady says to the dog, \\\"Say meow meow meow.\\\" The dog looks at the lady with a surprised, frustrated look and woofs in a human voice, \\\"What the heck lady?!\\\"\",\n    \"model\": \"veo-3.1-fast\",\n    \"aspectRatio\": \"portrait\",\n    \"referenceImage_1\": \"user:12345-email:6a6f...-image:abcde-...\",\n    \"async\": true\n  }'\n```\n\nMention each reference inline with an `@referenceImage_N`\n\nmarker in the prompt, add a `referenceAudio_1`\n\n(a system voice name like `Zephyr`\n\n) for narration, or pass a reusable [character](https://useapi.net/docs/api-google-flow-v1/post-google-flow-characters) as `character_1`\n\n(it drives the same R2V mode and counts toward the 3-reference budget). Omni Flash takes references further — up to 7, plus video-to-video editing and synced voices — see the [Omni Flash tutorial](https://useapi.net/docs/articles/omni-flash-bash).\n\nFinding the right shot takes many attempts, and running them by hand is tedious. The Node.js script reads a list of prompts from [ prompts.json](https://github.com/useapi/google-flow-api/blob/main/veo-video/prompts.json), uploads any start/end frame images, submits each job in async mode, then polls and downloads every finished MP4 — so you can queue a batch and come back to the winners.\n\nYou need [Node.js](https://nodejs.org) v21 or newer. Put `prompts.json`\n\nand [ google-flow.mjs](https://github.com/useapi/google-flow-api/blob/main/veo-video/google-flow.mjs) in the same folder and run\n\n`node ./google-flow.mjs API_TOKEN EMAIL`\n\n, where `API_TOKEN`\n\nis your useapi.net `EMAIL`\n\nis your connected `health`\n\nfield before submitting.Prefer to clone and run it locally? The complete `google-flow.mjs`\n\nand `prompts.json`\n\nare on GitHub in [ useapi/google-flow-api](https://github.com/useapi/google-flow-api/tree/main/veo-video).\n\nReal Veo 3.1 clips generated through this Google Flow API, taken straight from our release notes.\n\nFrom [Google Flow API v1: Initial Release](https://useapi.net/blog/251117). Animated from a Nano Banana still passed as `startImage`\n\n.\n\nFrom [Veo 3.1 Lite and Voice Narration](https://useapi.net/blog/260403). A reference-to-video generation with the `referenceAudio_1: \"Zephyr\"`\n\npreset adding spoken dialogue.\n\nFrom [Veo 3.1 Portrait R2V](https://useapi.net/blog/260113). Portrait R2V from a single reference image.\n\n`veo-3.1-quality`\n\nis the highest-fidelity model, `veo-3.1-fast`\n\nis the default balance, and `veo-3.1-lite`\n\nis the cheapest, with `veo-3.1-lite-low-priority`\n\navailable to Ultra subscribers at lower scheduling priority. See Supported models above for per-model credits and durations.`email`\n\n`mediaGenerationId.mediaGenerationId`\n\n) as `startImage`\n\n— and optionally `endImage`\n\nfor a first→last transition (Veo only, requires `startImage`\n\n). See Image-to-video above.`captchaToken`\n\nand relies on this automatic solving.Visit our [Discord Server](https://discord.gg/w28uK3cnmF) or [Telegram Channel](https://t.me/use_api) for any support questions and concerns.\n\nWe regularly post guides and tutorials on the [YouTube Channel](https://www.youtube.com/@midjourneyapi).\n\nCheck our [GitHub repo](https://github.com/useapi/google-flow-api) with code examples.", "url": "https://wpnews.pro/news/how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api", "canonical_source": "https://dev.to/useapi/how-to-generate-ai-video-with-veo-31-via-the-google-flow-api-2g4i", "published_at": "2026-06-18 04:23:24+00:00", "updated_at": "2026-06-18 04:51:27.068172+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "developer-tools", "ai-tools", "ai-infrastructure"], "entities": ["Google", "Veo 3.1", "useapi.net", "Google Flow API", "Gemini API", "Vertex AI", "Imagen 4", "Nano Banana"], "alternates": {"html": "https://wpnews.pro/news/how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api", "markdown": "https://wpnews.pro/news/how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api.md", "text": "https://wpnews.pro/news/how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api.txt", "jsonld": "https://wpnews.pro/news/how-to-generate-ai-video-with-veo-3-1-via-the-google-flow-api.jsonld"}}