Image GenerationImagen
Imagen 3
Google's highest quality text-to-image model with rich lighting, detail, and beauty.
POST /v2/images/generate — model: "imagen-3"
Google's highest quality Imagen 3 text-to-image model, capable of generating images with exceptional detail, rich lighting, and beauty. Features improved text rendering, better style reproduction, and reduced artifacts.
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 |
|---|
| 5 |
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 close-up macro photo of a hummingbird in flight sipping nectar from a vibrant flower, bokeh background",
"model": "imagen-3",
"imagenParams": {
"aspect_ratio": "1:1"
}
}'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 close-up macro photo of a hummingbird in flight sipping nectar from a vibrant flower, bokeh background",
"model": "imagen-3",
"imagenParams": {
"aspect_ratio": "1:1",
},
},
)
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 close-up macro photo of a hummingbird in flight sipping nectar from a vibrant flower, bokeh background",
model: "imagen-3",
imagenParams: { aspect_ratio: "1:1" },
}),
});
console.log(await response.json());Try it
POST
/v2/images/generateTry it