Imagen 4 API
activeGoogle's Imagen 4 — photorealistic image generation with exceptional detail and prompt adherence.
Quick Start
Send a request to the Imagen 4 API:
| 1 | curl -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
/api/v1/images/generationsSend a POST request with your API key to generate content using Imagen 4.
Headers
Bearer YOUR_API_KEY
application/json
Body Parameters
Model identifier: imagen-4
Text description of the image
Sub-model: imagen4-fast (4cr), imagen4 (8cr), or imagen4-ultra (12cr) Defaults to imagen4.
Aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16 Defaults to 1:1.
Elements to avoid in the generated image
Number of images to generate Defaults to 1.
Random seed for reproducibility
Example Request
| 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:
/api/v1/tasks/{task_id}Returns the current status of a generation task. Poll until status is 'completed' or 'failed'.
| 1 | curl 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:
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?
Ready to use Imagen 4?
Get Your API Key →