🌐

Imagen 4 API

active

Google's Imagen 4 — photorealistic image generation with exceptional detail and prompt adherence.

Googleimage8 credits/call
Provider
Google
Pricing
4–12 credits per image (~$0.008–$0.024)
Speed
3–8 seconds
Output
image

Quick Start

Send a request to the Imagen 4 API:

bash
1curl -X POST https://apiin.one/api/v1/images/generations \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "imagen4",
6 "prompt": "A photorealistic bowl of ramen with steam rising, side lighting, food photography",
7 "aspect_ratio": "1:1"
8}'

API Endpoint

POST/api/v1/images/generations

Send a POST request with your API key to generate content using Imagen 4.

Headers

Body ParametersJSON
Authorization:string

Bearer YOUR_API_KEY

Content-Type:string

application/json

Body Parameters

Body ParametersJSON
model:string

Model identifier: imagen-4

prompt:string

Text description of the image

model:optional string

Sub-model: imagen4-fast (4cr), imagen4 (8cr), or imagen4-ultra (12cr) Defaults to imagen4.

aspect_ratio:optional string

Aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16 Defaults to 1:1.

negative_prompt:optional string

Elements to avoid in the generated image

num_images:optional number

Number of images to generate Defaults to 1.

seed:optional number

Random seed for reproducibility

Example Request

json
1{
2 "model": "imagen4",
3 "prompt": "A photorealistic bowl of ramen with steam rising, side lighting, food photography",
4 "aspect_ratio": "1:1"
5}

Example Response

Successful task creation response.

1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "task_id": "n47xxxx_imagen4",
6 "status": "IN_PROGRESS"
7 }
8}

Check Task Status

For asynchronous tasks, poll the status endpoint to check when your task is complete:

GET/api/v1/tasks/{task_id}

Returns the current status of a generation task. Poll until status is 'completed' or 'failed'.

bash
1curl https://apiin.one/api/v1/tasks/task_abc123 \
2 -H "Authorization: Bearer aio_your_key"

Use Cases

  • Generate photorealistic product imagery
  • Create high-quality stock photography alternatives
  • Build design tools with Google-quality image generation
  • Produce marketing visuals with precise prompt control

API Tester

Test the Imagen 4 API directly from your browser:

API プレイグラウンドPOST

Error Codes

1{
2 "error": {
3 "code": 400,
4 "message": "Invalid parameters",
5 "type": "invalid_request"
6 }
7}

Frequently Asked Questions

How much does Imagen 4 cost?

Depends on sub-model: imagen4-fast costs 4 credits, imagen4 (standard) costs 8 credits, imagen4-ultra costs 12 credits.

Do I need a Google Cloud account?

No. API in One handles all authentication. No GCP project or billing setup needed.

Can I generate multiple images?

Yes. Set num_images to generate multiple images per request (each consumes credits independently).

Why Use Imagen 4 Through API in One?

1.Google-grade photorealism
2.3 quality tiers (fast/standard/ultra)
3.Negative prompt support
4.Seed-based reproducibility

Ready to use Imagen 4?

Get Your API Key →