Imagen 4.0 Generate API

imagen4/preview
Imagen 4.0 Generate: Google's high-quality text-to-image model with enhanced realism and understanding.
Output
$0.052 / gen
Released
Oct 13, 2025

How to use Imagen 4.0 Generate API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to imagen4/preview.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/images/generations",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "imagen4/preview",
      "prompt": "A cat holding a sign that says hello"
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/images/generations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "imagen4/preview",
    "prompt": "A cat holding a sign that says hello"
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/images/generations \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"imagen4/preview","prompt":"A cat holding a sign that says hello"}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Imagen 4.0 Generate API Pricing

TypePrice
Output
$0.052 / gen

Imagen 4.0 Generate vs other models

ModelInputOutputContextBest for
$0.052 / gen
High-fidelity text-to-image generation
$6.5 / 1M tokens
$52 / 1M tokens
Image generation at scale
Image generation at scale
$0.039 / MP (variable)
Image generation at scale
$0.0455 / gen
Image generation at scale

Frequently asked questions

Imagen 4.0 Generate takes image, text as input and returns image.

Imagen 4.0 Generate became available on October 13, 2025.

Imagen 4.0 Generate is priced at output $0.052 / gen.

Yes, Imagen 4.0 Generate accepts image input as well as a text prompt.

Imagen 4.0 Generate was built by Google.

Send a request to https://api.aimlapi.com/v1/images/generations with imagen4/preview as the model id.

Yes. Imagen 4.0 Generate is served through AI/ML API, so the same key and endpoint format used for other models applies.

Its model ID is imagen4/preview.

It is an image generation model that produces images from text prompts.

Start building with Imagen 4.0 Generate

Get API Key
1000+ models, one API.