Imagen 4 icon
Image by Google

Imagen 4 API

Google DeepMind's text-to-image model (May 2025), offered in Fast, Standard, and Ultra tiers and known for sharp text rendering, strong prompt following, and output up to 2K resolution.

Integrate Imagen 4 with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "imagen-4"
Imagen 4 breathtaking mountain range at dawn with a crystal-clear lake reflecting the snow-capped peaks

What's special about Imagen 4

A three-tier family behind one endpoint

Fast, Standard, and Ultra share the same prompt structure, so you can swap model IDs to balance speed, quality, and cost without rewriting your workflow.

A major leap in text rendering

It produces legible text with accurate font spacing and placement, handling text overlays far more reliably than earlier diffusion models.

Stricter prompt following

It adheres to detailed prompts closely and responds more accurately to camera and style direction than Imagen 3.

Up to 2K resolution

Both Standard and Ultra generate crisp 2048x2048 output, suitable for marketing assets and detailed compositions.

Versatile styles and aspect ratios

It renders photorealism, anime, watercolor, ink-wash, and more, across presets like 1:1, 4:3, 3:4, 9:16, and 16:9.

Built-in watermarking and safety

Every output carries Google's invisible SynthID watermark, alongside configurable safety settings and an optional prompt rewriter.

Made with Imagen 4

A few outputs generated through the Imagen 4 API on Apiframe.

Imagen 4 breathtaking mountain range at dawn with a crystal-clear lake reflecting the snow-capped peaks

A breathtaking mountain range at dawn with a crystal-clear lake reflecting the snow-capped peaks.

Imagen 4 magazine cover reading 'WILD' with a bold serif title and a close-up of a tiger's eye

A magazine cover reading 'WILD' with a bold serif title and a close-up of a tiger's eye.

Imagen 4 ultra-detailed product shot of a leather watch on linen in soft window light with fine texture

An ultra-detailed product shot of a leather watch on linen, soft window light, fine texture.

Imagen 4 watercolor illustration of a quiet Parisian street cafe in the rain

A watercolor illustration of a quiet Parisian street cafe in the rain.

Imagen 4 vertical 9:16 jazz night poster reading 'BLUE ROOM, FRIDAY 9PM' with art-deco type

A vertical 9:16 poster for a jazz night reading 'BLUE ROOM, FRIDAY 9PM' with art-deco type.

Imagen 4 photorealistic close-up of dew droplets on a spiderweb at sunrise with crisp detail

A photorealistic close-up of dew droplets on a spiderweb at sunrise, crisp detail.

Overview

Endpoint
POST /v2/images/generate
Model ID
imagen-4
Params key
imagenParams
Modality
Image
Provider
Google
Avg. completion
~15s

Capabilities

Aspect ratios1:1, 9:16, 16:9, 3:4, 4:3
Avg. time~15s

Quick start

Send a single POST /v2/images/generate request with your API key to generate with Imagen 4. The call returns a jobId you can poll or receive via webhook.

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 sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "imagen-4",
        "imagenParams": {
            "image_size": "1K",
            "output_format": "jpg"
        }
    }'
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 sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "imagen-4",
        "imagenParams": {
            "image_size": "1K",
            "output_format": "jpg"
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
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 sleek silver sports car on a coastal highway at sunset, hyper-realistic",
    "model": "imagen-4",
    "imagenParams": {
      "image_size": "1K",
      "output_format": "jpg"
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the Imagen 4 endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "imagen-4" "imagen-4" The model identifier for this endpoint.
imagenParams.image_size string optional "1K" "1K", "2K" Resolution
imagenParams.output_format string optional "jpg" "jpg", "png" Output format

Frequently Asked Questions

Common questions about the Imagen 4 API.

What is Imagen 4?

Google DeepMind's text-to-image model, released in May 2025, available in three tiers through the Gemini API, Google AI Studio, and Vertex AI.

What is the difference between Fast, Standard, and Ultra?

Fast prioritizes speed and low cost at 4 credits ($0.04) per image, Standard balances quality and price at 7 credits ($0.07), and Ultra delivers the highest detail and prompt adherence at 11 credits ($0.11).

What resolution does it produce?

Up to 2K (2048x2048) on Standard and Ultra, with the Fast tier topping out lower.

Is it good at rendering text in images?

Yes. Cleaner, more legible typography is one of its biggest improvements over Imagen 3.

Does it watermark generated images?

Yes. Every image includes Google's invisible SynthID watermark.

Where can you access it?

Through Apiframe, as well as the Gemini API, Google AI Studio, and Vertex AI.

Still have questions?

Start building with the Imagen 4 API

Get your API key and integrate Imagen 4 in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.