Google Flow
Image & Video API
OpenAI-compatible API for Google's Imagen 4, Nano Banana 2, Nano Banana Pro image generation and Veo 2/3.1 video generation. Supports text-to-image, image-to-image, text-to-video, image-to-video, and reference-based video generation.
Returns all available image and video generation models with their IDs and descriptions.
curl BASE_URL/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
{
"object": "list",
"data": [
{
"id": "gemini-3.1-flash-image-landscape",
"object": "model",
"owned_by": "flow2api",
"description": "Image generation - NARWHAL"
},
...
]
}
List simplified model aliases for generationConfig-based resolution. Useful when using Gemini-native endpoints.
curl BASE_URL/v1/models/aliases \
-H "Authorization: Bearer YOUR_API_KEY"
The primary endpoint. OpenAI-compatible unified generation for images and videos. Select a model to control what gets generated. Supports streaming responses.
| Parameter | Type | Description |
|---|---|---|
| model required | string | Model ID (e.g. gemini-3.1-flash-image-landscape) |
| messages required | array | Array of { role, content } messages. Content can be a string (text prompt) or array of content parts for multimodal input. |
| stream optional | boolean | Enable streaming response. Default: false |
| image optional | string | Base64-encoded image for image-to-image generation |
| video optional | string | Base64-encoded video for video reference |
curl -X POST BASE_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image-landscape",
"messages": [
{
"role": "user",
"content": "A red apple on a wooden table, studio lighting, minimal background"
}
],
"stream": true
}'
curl -X POST BASE_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image-landscape",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Turn this into a watercolor painting style"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,<BASE64_IMAGE>"
}
}
]
}
],
"stream": true
}'
curl -X POST BASE_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo_3_1_t2v_fast_landscape",
"messages": [
{
"role": "user",
"content": "A kitten chasing butterflies across a sunlit meadow"
}
],
"stream": true
}'
curl -X POST BASE_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo_3_1_i2v_s_fast_fl",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Transition from the first frame to the second"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,<FIRST_FRAME_BASE64>"
}
},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,<LAST_FRAME_BASE64>"
}
}
]
}
],
"stream": true
}'
curl -X POST BASE_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo_3_1_r2v_fast",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Create a video featuring these reference elements"
},
{
"type": "image_url",
"image_url": { "url": "data:image/jpeg;base64,<REF1>" }
},
{
"type": "image_url",
"image_url": { "url": "data:image/jpeg;base64,<REF2>" }
}
]
}
],
"stream": true
}'
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","model":"gemini-3.1-flash-image-landscape","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: [DONE]
Gemini-native endpoint. Supports systemInstruction, contents[].parts[].text,
inlineData, fileData, and generationConfig with responseModalities
and imageConfig. Also available at /v1beta/models/{model}:generateContent.
| Parameter | Type | Description |
|---|---|---|
| contents required | array | Array of content objects with role and parts |
| systemInstruction optional | object | System instruction with parts[].text |
| generationConfig optional | object | responseModalities (e.g. ["IMAGE"]), imageConfig.aspectRatio (e.g. "1:1"), imageConfig.imageSize (e.g. "1K", "2K", "4K") |
curl -X POST BASE_URL/models/gemini-3.1-flash-image:generateContent \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"systemInstruction": {
"parts": [{ "text": "Return an image only." }]
},
"contents": [
{
"role": "user",
"parts": [
{ "text": "A red apple on a wooden table, studio lighting" }
]
}
],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "1K"
}
}
}'
{
"candidates": [
{
"content": {
"parts": [
{
"inlineData": {
"mimeType": "image/png",
"data": "iVBORw0KGgo..."
}
}
],
"role": "model"
}
}
]
}
Same as generateContent but returns a streaming response. Also available at /v1beta/models/{model}:streamGenerateContent. Append ?alt=sse for SSE format.
curl -X POST "BASE_URL/models/gemini-3.0-pro-image:streamGenerateContent?alt=sse" \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [{ "text": "Generate an artistic portrait" }]
}
],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": { "aspectRatio": "3:4", "imageSize": "2K" }
}
}'
Add a new Google session token (ST — __Secure-next-auth.session-token cookie value from labs.google). The service will automatically obtain an access token (AT) from it. Requires admin authentication.
| Parameter | Type | Description |
|---|---|---|
| st required | string | The session token cookie value |
| remark optional | string | A label/note for this token |
| image_enabled optional | boolean | Enable image generation for this token. Default: true |
| video_enabled optional | boolean | Enable video generation for this token. Default: true |
curl -X POST BASE_URL/api/tokens \
-H "Content-Type: application/json" \
-b "session=ADMIN_SESSION_COOKIE" \
-d '{
"st": "YOUR_GOOGLE_SESSION_TOKEN",
"remark": "Main account"
}'
List all registered Google session tokens and their status. Requires admin authentication.
curl BASE_URL/api/tokens \
-b "session=ADMIN_SESSION_COOKIE"
Returns system information including version, uptime, token count, and configuration. Requires admin authentication.
curl BASE_URL/api/system/info \
-b "session=ADMIN_SESSION_COOKIE"
Nano Banana 2 (NARWHAL) — gemini-3.1-flash-image
| Model ID | Orientation | Resolution |
|---|---|---|
| gemini-3.1-flash-image-landscape | Landscape | Standard |
| gemini-3.1-flash-image-portrait | Portrait | Standard |
| gemini-3.1-flash-image-square | Square | Standard |
| gemini-3.1-flash-image-four-three | 4:3 | Standard |
| gemini-3.1-flash-image-three-four | 3:4 | Standard |
| gemini-3.1-flash-image-landscape-2k | Landscape | 2K |
| gemini-3.1-flash-image-portrait-2k | Portrait | 2K |
| gemini-3.1-flash-image-square-2k | Square | 2K |
| gemini-3.1-flash-image-four-three-2k | 4:3 | 2K |
| gemini-3.1-flash-image-three-four-2k | 3:4 | 2K |
| gemini-3.1-flash-image-landscape-4k | Landscape | 4K |
| gemini-3.1-flash-image-portrait-4k | Portrait | 4K |
| gemini-3.1-flash-image-square-4k | Square | 4K |
| gemini-3.1-flash-image-four-three-4k | 4:3 | 4K |
| gemini-3.1-flash-image-three-four-4k | 3:4 | 4K |
Nano Banana Pro (GEM_PIX_2) — gemini-3.0-pro-image
| Model ID | Orientation | Resolution |
|---|---|---|
| gemini-3.0-pro-image-landscape | Landscape | Standard |
| gemini-3.0-pro-image-portrait | Portrait | Standard |
| gemini-3.0-pro-image-square | Square | Standard |
| gemini-3.0-pro-image-four-three | 4:3 | Standard |
| gemini-3.0-pro-image-three-four | 3:4 | Standard |
| gemini-3.0-pro-image-landscape-2k | Landscape | 2K |
| gemini-3.0-pro-image-portrait-2k | Portrait | 2K |
| gemini-3.0-pro-image-square-2k | Square | 2K |
| gemini-3.0-pro-image-four-three-2k | 4:3 | 2K |
| gemini-3.0-pro-image-three-four-2k | 3:4 | 2K |
| gemini-3.0-pro-image-landscape-4k | Landscape | 4K |
| gemini-3.0-pro-image-portrait-4k | Portrait | 4K |
| gemini-3.0-pro-image-square-4k | Square | 4K |
| gemini-3.0-pro-image-four-three-4k | 4:3 | 4K |
| gemini-3.0-pro-image-three-four-4k | 3:4 | 4K |
Imagen 4 (IMAGEN_3_5) — imagen-4.0-generate-preview
| Model ID | Orientation | Resolution |
|---|---|---|
| imagen-4.0-generate-preview-landscape | Landscape | Standard |
| imagen-4.0-generate-preview-portrait | Portrait | Standard |
Gemini Flash (GEM_PIX) — gemini-2.5-flash-image
| Model ID | Orientation | Resolution |
|---|---|---|
| gemini-2.5-flash-image-landscape | Landscape | Standard |
| gemini-2.5-flash-image-portrait | Portrait | Standard |
Text-to-Video (T2V)
| Model ID | Orientation | Quality |
|---|---|---|
| veo_3_1_t2v_fast_landscape | Landscape | Fast |
| veo_3_1_t2v_fast_portrait | Portrait | Fast |
| veo_3_1_t2v_landscape | Landscape | Standard |
| veo_3_1_t2v_portrait | Portrait | Standard |
| veo_3_1_t2v_fast_ultra | Landscape | Ultra |
| veo_3_1_t2v_fast_portrait_ultra | Portrait | Ultra |
| veo_3_1_t2v_fast_ultra_relaxed | Landscape | Ultra Relaxed |
| veo_3_1_t2v_fast_portrait_ultra_relaxed | Portrait | Ultra Relaxed |
| veo_2_1_fast_d_15_t2v_landscape | Landscape | Veo 2.1 |
| veo_2_1_fast_d_15_t2v_portrait | Portrait | Veo 2.1 |
| veo_2_0_t2v_landscape | Landscape | Veo 2.0 |
| veo_2_0_t2v_portrait | Portrait | Veo 2.0 |
Image-to-Video (I2V) — First/Last Frame
1 image = first frame only. 2 images = first frame + last frame transition.
| Model ID | Orientation | Quality |
|---|---|---|
| veo_3_1_i2v_s_fast_fl | Landscape | Fast |
| veo_3_1_i2v_s_fast_portrait_fl | Portrait | Fast |
| veo_3_1_i2v_s_fast_ultra_fl | Landscape | Ultra |
| veo_3_1_i2v_s_fast_portrait_ultra_fl | Portrait | Ultra |
| veo_3_1_i2v_s_fast_ultra_relaxed | Landscape | Ultra Relaxed |
| veo_3_1_i2v_s_fast_portrait_ultra_relaxed | Portrait | Ultra Relaxed |
| veo_3_1_i2v_s_landscape | Landscape | Standard |
| veo_3_1_i2v_s_portrait | Portrait | Standard |
| veo_2_1_fast_d_15_i2v_landscape | Landscape | Veo 2.1 |
| veo_2_1_fast_d_15_i2v_portrait | Portrait | Veo 2.1 |
| veo_2_0_i2v_landscape | Landscape | Veo 2.0 |
| veo_2_0_i2v_portrait | Portrait | Veo 2.0 |
Reference-to-Video (R2V) — Multiple Reference Images
Up to 3 reference images. System auto-selects model key based on image count.
| Model ID | Orientation | Quality |
|---|---|---|
| veo_3_1_r2v_fast | Landscape | Fast |
| veo_3_1_r2v_fast_portrait | Portrait | Fast |
| veo_3_1_r2v_fast_ultra | Landscape | Ultra |
| veo_3_1_r2v_fast_portrait_ultra | Portrait | Ultra |
| veo_3_1_r2v_fast_ultra_relaxed | Landscape | Ultra Relaxed |
| veo_3_1_r2v_fast_portrait_ultra_relaxed | Portrait | Ultra Relaxed |
Video Upscale Models
Upscale generated videos to 1080p or 4K resolution.
| Model ID | Source | Output |
|---|---|---|
| veo_3_1_t2v_fast_4k | T2V | 4K |
| veo_3_1_t2v_fast_portrait_4k | T2V | 4K |
| veo_3_1_t2v_fast_ultra_4k | T2V Ultra | 4K |
| veo_3_1_t2v_fast_portrait_ultra_4k | T2V Ultra | 4K |
| veo_3_1_t2v_fast_1080p | T2V | 1080p |
| veo_3_1_t2v_fast_portrait_1080p | T2V | 1080p |
| veo_3_1_t2v_fast_ultra_1080p | T2V Ultra | 1080p |
| veo_3_1_t2v_fast_portrait_ultra_1080p | T2V Ultra | 1080p |
| veo_3_1_i2v_s_fast_ultra_fl_4k | I2V Ultra | 4K |
| veo_3_1_i2v_s_fast_portrait_ultra_fl_4k | I2V Ultra | 4K |
| veo_3_1_i2v_s_fast_ultra_fl_1080p | I2V Ultra | 1080p |
| veo_3_1_i2v_s_fast_portrait_ultra_fl_1080p | I2V Ultra | 1080p |
| veo_3_1_r2v_fast_ultra_4k | R2V Ultra | 4K |
| veo_3_1_r2v_fast_portrait_ultra_4k | R2V Ultra | 4K |
| veo_3_1_r2v_fast_ultra_1080p | R2V Ultra | 1080p |
| veo_3_1_r2v_fast_portrait_ultra_1080p | R2V Ultra | 1080p |
Important Notes
- All generation endpoints use streaming (
"stream": true) for best results. The response is delivered via Server-Sent Events (SSE). - Image models return base64-encoded images in the response content. Video models return base64-encoded MP4 video data.
- The Google session token (ST) expires periodically. Update it via the Admin Panel or use the browser extension Flow2API-Token-Updater for automatic refresh.
- Image-to-Video models support 1 image (first frame) or 2 images (first + last frame transition).
- Reference-to-Video (R2V) models support up to 3 reference images.
- reCAPTCHA Enterprise is solved automatically by the service using the configured captcha method (browser/yescaptcha/personal).
- Multiple Google tokens are supported for load balancing. Add more tokens in the Admin Panel for higher throughput.
- Concurrency is controlled per-token and globally. The service will queue requests that exceed the configured concurrency limit.
- Video upscale models (4K/1080p) generate higher resolution versions of an existing video generation.