Google Imagen Models (Deprecated)
All Google Imagen model IDs are deprecated and no longer listed in data/models.json, so do not use the older imagen-* examples or the v1beta :predict image route for new AvalAI integrations. This page remains only to help developers migrate old bookmarks and code snippets.
Deprecated Models
| Deprecated model | Replacement |
|---|---|
imagen-4.0-ultra-generate-001 | gemini-3-pro-image (Nano Banana Pro) |
imagen-4.0-generate-001 | gemini-3.1-flash-image (Nano Banana 2) |
imagen-4.0-fast-generate-001 | gemini-3.1-flash-image (Nano Banana 2) |
imagen-3.0-generate-002 | gemini-3.1-flash-lite-image (Nano Banana 2 Lite) |
imagen-3.0-generate-001 | gemini-3.1-flash-lite-image (Nano Banana 2 Lite) |
imagen-3.0-fast-generate-001 | gemini-3.1-flash-lite-image (Nano Banana 2 Lite) |
What to Use Instead
- Nano Banana series: Use
gemini-3.1-flash-image,gemini-3-pro-image, orgemini-3.1-flash-lite-imagefor Google image generation and editing throughv1/chat/completionsor the nativev1beta:generateContentendpoint. (gemini-2.5-flash-imageshuts down on October 2, 2026, so prefer the Gemini 3.x image models for new integrations.) - GPT Image: Use
gpt-image-2for high-quality generation, editing, text rendering, compositing, and mask-based edits throughv1/images/generationsandv1/images/edits. - Other providers: FLUX (
flux.2-pro,flux.1-kontext-pro), Qwen Image, and Seedream remain available for direct image generation workloads.
Migration Example
Old Imagen native-API call:
bash
# Deprecated - do not use
curl -X POST \
"https://api.avalai.ir/v1beta/models/imagen-4.0-fast-generate-001:predict" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"instances": [{"prompt": "A serene Japanese garden"}], "parameters": {"sampleCount": 1}}'New Nano Banana call through the OpenAI-compatible endpoint:
bash
curl https://api.avalai.ir/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "gemini-3.1-flash-image",
"messages": [
{"role": "user", "content": "Generate a serene Japanese garden with a koi pond"}
],
"modalities": ["image", "text"]
}'python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="gemini-3.1-flash-image",
messages=[
{"role": "user", "content": "Generate a serene Japanese garden with a koi pond"}
],
modalities=["image", "text"],
)
images = response.choices[0].message.images
if images:
print("Image URL:", images[0]["image_url"]["url"])javascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.chat.completions.create({
model: "gemini-3.1-flash-image",
messages: [
{ role: "user", content: "Generate a serene Japanese garden with a koi pond" },
],
modalities: ["image", "text"],
});
const images = response.choices[0].message.images;
if (images?.length) {
console.log("Image URL:", images[0].image_url.url);
}For the full prompting playbook, aspect-ratio and image-size controls, and editing examples, see the Nano Banana series guide and the model deprecations and migration guide.
For model availability, always check data/models.json through the Models API or the model browser.