Image GenerationImagen
Imagen 4 Fast
Fast version of Imagen 4 for when speed and cost are more important than quality.
POST /v2/images/generate — model: "imagen-4-fast"
The fast version of Google's Imagen 4, optimized for speed and cost efficiency. Ideal for rapid prototyping, high-volume generation, and use cases where generation time matters more than maximum quality.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
imagenParams.aspect_ratio | string | Aspect ratio. Values: "1:1" (default), "9:16", "16:9", "3:4", "4:3" |
imagenParams.output_format | string | Output format. Values: "jpg" (default), "png" |
Credit cost
| Credits per generation |
|---|
| 2 |
Code examples
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A gorilla riding a moped through a busy Italian city, cinematic street photography",
"model": "imagen-4-fast",
"imagenParams": {
"aspect_ratio": "4:3"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "A gorilla riding a moped through a busy Italian city, cinematic street photography",
"model": "imagen-4-fast",
"imagenParams": {
"aspect_ratio": "4:3",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A gorilla riding a moped through a busy Italian city, cinematic street photography",
model: "imagen-4-fast",
imagenParams: { aspect_ratio: "4:3" },
}),
});
console.log(await response.json());Try it
POST
/v2/images/generateTry it