🌐

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
curl -X POST https://apiin.one/api/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "imagen4",
  "prompt": "A photorealistic bowl of ramen with steam rising, side lighting, food photography",
  "aspect_ratio": "1:1"
}'

API Endpoint

POST/api/v1/images/generations
Send a POST request with your API key to generate content using Imagen 4.

Headers

Header유형필수설명
Authorizationstring필수Bearer YOUR_API_KEY
Content-Typestring필수application/json

Body Parameters

매개변수유형필수설명
modelstring필수Model identifier: "imagen-4"
promptstring필수Text description of the image
modelstring선택 사항Sub-model: "imagen4-fast" (4cr), "imagen4" (8cr), or "imagen4-ultra" (12cr) (기본값: imagen4)
aspect_ratiostring선택 사항Aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16 (기본값: 1:1)
negative_promptstring선택 사항Elements to avoid in the generated image
num_imagesnumber선택 사항Number of images to generate (기본값: 1)
seednumber선택 사항Random seed for reproducibility

Example Request

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

Example Response

Successful task creation response.

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n47xxxx_imagen4",
    "status": "IN_PROGRESS"
  }
}

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
curl https://apiin.one/api/v1/tasks/task_abc123 \
  -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

{
  "error": {
    "code": 400,
    "message": "Invalid parameters",
    "type": "invalid_request"
  }
}

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?

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

Ready to use Imagen 4?

Get Your API Key →