🌐
Imagen 4 API
activeGoogle'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/generationsSend a POST request with your API key to generate content using Imagen 4.
Headers
| Header | Tipo | Requerido | Descripción |
|---|---|---|---|
Authorization | string | Requerido | Bearer YOUR_API_KEY |
Content-Type | string | Requerido | application/json |
Body Parameters
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
model | string | Requerido | Model identifier: "imagen-4" |
prompt | string | Requerido | Text description of the image |
model | string | Opcional | Sub-model: "imagen4-fast" (4cr), "imagen4" (8cr), or "imagen4-ultra" (12cr) (Predeterminado: imagen4) |
aspect_ratio | string | Opcional | Aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16 (Predeterminado: 1:1) |
negative_prompt | string | Opcional | Elements to avoid in the generated image |
num_images | number | Opcional | Number of images to generate (Predeterminado: 1) |
seed | number | Opcional | 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:
Consola de APIPOST
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 →