Imagen 4 API
https://api.hiapi.ai /v1/tasks Image, video, and audio models are called through theUnified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).
Model summary
| Model name | Google-Imagen4 |
|---|---|
| Type | Image generation (text-to-image) |
| Endpoint | POST /v1/tasks |
| Pricing | See HiAPI Pricing |
Imagen 4 text-to-image API for high-quality images from detailed prompts.
Production guidance
- Pass callback.url at the top level in production to reduce polling.
- Poll GET /v1/tasks/:id for local debugging.
Best suited for
Product heroes, lifestyle visuals and campaign drafts in 6 aspect ratios; 16:9 by default.
promptaspect_ratioseed is a string of up to 500 characters; fix it to see only the prompt change.
seednegative_promptRequest parameters
model string required Fixed value Google-Imagen4.
input object required Put model parameters inside input.
prompt string required Required image description, up to 5,000 characters.
aspect_ratio enum required Output aspect ratio.
negative_prompt string optional Optional negative prompt, up to 5,000 characters.
seed string optional Optional string, up to 500 characters.
callback object optional Optional terminal task callback.
url string required HTTPS endpoint that receives terminal task notifications.
when enum optional Callback timing; keep final.
Example requests
A four-part prompt: the task, what to show, what to keep, and texture and limits.
{
"model": "Google-Imagen4",
"input": {
"prompt": "Create a premium skincare product photo for a landing-page hero. Show one frosted glass bottle on natural stone beside still water and green botanicals. Keep the bottle centered with empty space on the left for a headline. Warm daylight and soft shadows; the result should look like calm studio photography. Do not add logos or text.",
"aspect_ratio": "16:9"
}
}The prompt as submitted for an example on the model page.
{
"model": "Google-Imagen4",
"input": {
"prompt": "Elderly fisherman mending nets on a harbor pier; golden hour; documentary portrait",
"aspect_ratio": "3:4"
}
}Getting the result
- The response returns a taskId immediately.
- Wait for callback.url or poll GET /v1/tasks/:id.
- When status=success, download output[].url.
FAQ
Does it accept reference images?
No. Imagen 4 generates from text only.
What type is seed?
An optional string of up to 500 characters.
Imagen 4, Fast or Ultra?
Use Imagen 4 for everyday production, imagen4-fast for many drafts, and imagen4-ultra when the final needs more detail.
How do I retrieve the result?
Use the taskId. The response returns it right away; download output[].url after the task succeeds.
How can I confirm the cost?
The task record is final. Check the pricing page and Playground estimate before submitting. View pricing