AI Models
Nano Banana 3.1 Flash
Fast, high-volume AI image generation. Generate and edit images from text prompts with reference images, aspect ratios, and resolutions up to 4K.
POST
~$0.10 est./v1/media/queueOverview
Fast, high-volume image generation via Google's Nano Banana 3. Generates and edits images from text prompts with optional reference images.
| Property | Value |
|---|---|
| Model ID | google/nano-banana-3-flash |
| Upstream Model | gemini-3.1-flash-image-preview |
| Billing | Token-based (dynamic) |
| Input Price | $1.00 / 1M tokens |
| Output Price (image) | $120.00 / 1M tokens |
| Typical Cost | ~$0.10 per image |
Usage
All media models use the async job queue. Submit a job, then poll for the result.
Step 1: Submit Job
Text-to-Image
const res = await fetch('https://api.yepapi.com/v1/media/queue', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'google/nano-banana-3-flash',
prompt: 'A futuristic city skyline at sunset with flying vehicles',
options: { aspectRatio: '16:9' },
}),
});
const { data } = await res.json();
// data.jobId — use this to poll for results
// data.status — "pending"curl -X POST https://api.yepapi.com/v1/media/queue \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "google/nano-banana-3-flash", "prompt": "A futuristic city skyline at sunset", "options": {"aspectRatio": "16:9"}}'Image-to-Image (Edit / Transform)
Pass a reference image via imageData alongside your prompt to edit or transform an existing image.
const res = await fetch('https://api.yepapi.com/v1/media/queue', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'google/nano-banana-3-flash',
prompt: 'Make the sky purple and add northern lights',
options: { aspectRatio: '16:9' },
imageData: {
mimeType: 'image/png',
base64: '...', // Base64-encoded image
},
}),
});Step 2: Poll for Result
const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, {
headers: { 'x-api-key': 'YOUR_API_KEY' },
});
const { data: job } = await status.json();
// job.status — "pending" | "processing" | "completed" | "failed"
// job.result.image — { mimeType, base64 } when completedcurl https://api.yepapi.com/v1/media/status/JOB_ID \
-H "x-api-key: YOUR_API_KEY"Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
model | string | Yes | google/nano-banana-3-flash | — |
prompt | string | Yes | Text description of the image to generate or edit | — |
options.aspectRatio | string | No | Aspect ratio (1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9) | 1:1 |
options.resolution | string | No | Output resolution (512, 1K, 2K, 4K) — 512 Flash only | 1K |
imageData.mimeType | string | No | MIME type of input image (image/png, image/jpeg, image/webp) | — |
imageData.base64 | string | No | Base64-encoded input image for image-to-image editing | — |
Features
- Text-to-image and image-to-image (edit/transform) in one endpoint
- Up to 14 reference images for guided generation
- Aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, and more
- Resolutions: 512 (Flash only), 1K, 2K, 4K
- Thinking mode for complex prompts
- Google Search grounding
Under the Hood
Powered by Google's Gemini API directly.