Nano Banana 2 Reference to Image
Model ID google/nano-banana-2/reference-to-image
Overview
Generate a still image from one source video clip and optional reference images.
Endpoint
POST /v1/images/generations/async
Authentication
Authorization: Bearer <AIAPIAIAPI_API_KEY>
Request Body
| Parameter | Type | Required | Nullable | Default | Constraints | Description |
|---|---|---|---|---|---|---|
model | string | Yes | No | - | values: google/nano-banana-2/reference-to-image | Model ID used to route the request. |
prompt | string | Yes | No | - | - | Text prompt describing the desired output. |
images | array | No | No | - | max_count: 10; accepts: URL, Base64 data URL | Source images; optional alongside the source video in reference-to-image mode. |
resolution | string | No | No | `1k` | values: 1k, 2k, 4k | Output image resolution. |
aspect_ratio | string | No | No | - | values: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | Output image aspect ratio. |
seed | integer | No | No | `-1` | - | Random seed; -1 selects a random seed. Determinism is not guaranteed. |
output_format | string | No | No | `default` | values: default, png, jpeg | Output file format. |
enable_web_search | boolean | No | No | `false` | - | Ground generation with web search. |
enable_image_search | boolean | No | No | `false` | - | Use image search results as visual context. |
thinking_level | string | No | No | `default` | values: default, high, minimal | Internal reasoning level; higher levels may improve quality but increase latency. |
media_resolution | string | No | No | `default` | values: default, low, medium, high | Input media processing detail. |
top_p | number | No | No | `0.95` | range: 0-1 | Top-p sampling probability threshold. |
temperature | number | No | No | `1` | range: 0-1 | Sampling temperature controlling creativity. |
video_clips | array | Yes | No | - | min_items: 1; max_count: 1 | Exactly one HTTP or YouTube video. HTTP videos are limited to 15 MB (validated by the provider). start and ends are seconds; ends=0 uses the whole video. fps must be 0–24. All four properties are required. |
model
Type: string · Required: Yes · Nullable: No
Model ID used to route the request.
prompt
Type: string · Required: Yes · Nullable: No
Text prompt describing the desired output.
images
Type: array · Required: No · Nullable: No
Source images; optional alongside the source video in reference-to-image mode.
resolution
Type: string · Required: No · Nullable: No
Output image resolution.
aspect_ratio
Type: string · Required: No · Nullable: No
Output image aspect ratio.
seed
Type: integer · Required: No · Nullable: No
Random seed; -1 selects a random seed. Determinism is not guaranteed.
output_format
Type: string · Required: No · Nullable: No
Output file format.
enable_web_search
Type: boolean · Required: No · Nullable: No
Ground generation with web search.
enable_image_search
Type: boolean · Required: No · Nullable: No
Use image search results as visual context.
thinking_level
Type: string · Required: No · Nullable: No
Internal reasoning level; higher levels may improve quality but increase latency.
media_resolution
Type: string · Required: No · Nullable: No
Input media processing detail.
top_p
Type: number · Required: No · Nullable: No
Top-p sampling probability threshold.
temperature
Type: number · Required: No · Nullable: No
Sampling temperature controlling creativity.
video_clips
Type: array · Required: Yes · Nullable: No
Exactly one HTTP or YouTube video. HTTP videos are limited to 15 MB (validated by the provider). start and ends are seconds; ends=0 uses the whole video. fps must be 0–24. All four properties are required.
Request Example
curl --request POST \
--url https://aiapiaiapi.com/v1/images/generations/async \
--header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "google/nano-banana-2/reference-to-image",
"prompt": "A cinematic camera movement through a forest",
"resolution": "1k",
"video_clips": [{"ends":0,"fps":1,"start":0,"url":"https://example.com/reference.mp4"}]
}'JSON
{
"model": "google/nano-banana-2/reference-to-image",
"prompt": "A cinematic camera movement through a forest",
"resolution": "1k",
"video_clips": [{"ends":0,"fps":1,"start":0,"url":"https://example.com/reference.mp4"}]
}Response
{
"code": "success",
"message": "",
"data": { "task_id": "image_01K2ABC123" }
}Task Status
Use the task_id from the create response:
GET /v1/images/generations/async/{task_id}
{
"code": "success",
"message": "",
"data": {
"task_id": "image_01K2ABC123",
"status": "SUCCESS",
"progress": "100%",
"outputs": ["https://cdn.example.com/images/image_01K2ABC123.png"],
"start_time": 1786960805,
"finish_time": 1786960900,
"submit_time": 1786960800,
"fail_reason": ""
}
}Error Responses
Validation errors return HTTP 400 with a stable error code.
{
"code": "unsupported_parameter",
"message": "The parameter is not supported by this model.",
"data": null
}Documentation Index
Fetch the complete documentation index at:
https://aiapiaiapi.com/llms.txt
Use this file to discover all available API documentation.