TL;DR
- Imagen 4 (
Google-Imagen4) is a text-to-image model at $0.06 per image: one prompt, one aspect ratio, one image — built for portrait photography, natural close-ups, and product stills. Try it on the model page; new accounts get 200 free credits. - The series has two more tiers:
imagen4-fastat $0.03 for high-volume drafting, andimagen4-ultraat $0.09 for finished-detail output. - Everything runs on the HiAPI
/v1/tasksendpoint: submit for ataskId, poll for the result, then download fromoutput[0].url.
What it does
- Text to image, no reference needed: the prompt describes the whole frame, and
aspect_ratiois required (1:1, 16:9, 9:16, 3:4, 4:3, auto). - Three tiers, one family: Fast for drafts, standard for everyday production, Ultra for detail — three model IDs you can stage across one project.
- One image per call: no batch count, pixel size, or output format parameters; change the
seedto reroll.
Here's a real output from the standard tier:
Sunlit Scandinavian living room with linen sofa; oak shelves and a monstera plant; editorial interior photography

Google-Imagen4, 16:9, 1280×720, $0.06.
Three tiers: which to use
imagen4-fast | Google-Imagen4 (standard) | imagen4-ultra | |
|---|---|---|---|
| Per image | $0.03 | $0.06 | $0.09 |
| Role | High-volume drafts, picking directions | Everyday production | Finished detail, materials, lettering |
| $10 yields | 333 images | 166 images | 111 images |
| Best for | Brainstorms, sketch rounds | Regular delivery | Final assets, detail-critical frames |
The calling convention is identical across the three — change only the model field; the parameter structure matches too, except the seed type (see the table). There's a dedicated guide for each sibling: Imagen 4 Fast API guide and Imagen 4 Ultra API guide. For scene-by-scene recipes, see the prompt guide.
Two ways to start
Browser, 3 steps: open the model page → paste the prompt and pick an aspect ratio → generate. A standard image is $0.06.
API, 3 steps: POST /v1/tasks to submit → take the taskId → GET /v1/tasks/<taskId> until success, then download.
curl: your first image
curl -X POST https://api.hiapi.ai/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: your-unique-key-001" \
-d '{
"model": "Google-Imagen4",
"input": {
"prompt": "Sunlit Scandinavian living room with linen sofa; oak shelves and a monstera plant; editorial interior photography",
"aspect_ratio": "16:9"
}
}'
Switch tiers by changing model to imagen4-fast or imagen4-ultra. The response carries the taskId you'll poll with.
Python: submit, poll, download
import time, uuid, requests
BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"model": "Google-Imagen4",
"input": {
"prompt": "Sunlit Scandinavian living room with linen sofa; oak shelves and a monstera plant; editorial interior photography",
"aspect_ratio": "16:9",
},
}
# Submit: the Idempotency-Key makes network retries safe
resp = requests.post(
BASE,
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json=payload,
timeout=30,
)
resp.raise_for_status()
task_id = resp.json()["taskId"]
# Poll: queued -> handling -> archiving -> success / fail
while True:
task = requests.get(f"{BASE}/{task_id}", headers=HEADERS, timeout=30).json()
print(task["status"])
if task["status"] in ("success", "fail"):
break
time.sleep(3)
if task["status"] == "success":
image_url = task["output"][0]["url"] # temporary URL — download promptly
img = requests.get(image_url, timeout=60)
with open("output_image", "wb") as f: # name the extension to match the actual format
f.write(img.content)
print("saved")
Parameters
| Field | Required | Values | Notes |
|---|---|---|---|
prompt | yes | 1–5,000 chars | What the frame contains |
aspect_ratio | yes | 1:1 / 16:9 / 9:16 / 3:4 / 4:3 / auto | Output aspect, required |
negative_prompt | no | ≤5,000 chars | What to keep out |
seed | no | standard & Ultra: string (≤500 chars); Fast: integer | Same inputs + same seed reproduce the image |
All three models share this table. Any field outside it returns a 400.
Errors you'll actually hit
| Status | Meaning | What to do |
|---|---|---|
| 400 INVALID_REQUEST | Malformed body (missing prompt or aspect_ratio, bad enum value, unknown field) | Fix the payload against the parameter table |
| 402 INSUFFICIENT_QUOTA | Out of credits (no charge) | Top up and retry |
| 429 RATE_LIMITED | Rate limited | Slow your submission rate |
| 409 / 422 IDEMPOTENCY_KEY_* | Same idempotency key resubmitted (processing / payload mismatch) | Generate a fresh key |
| 415 UNSUPPORTED_MEDIA_TYPE | Wrong request format | Check Content-Type: application/json |
Terminal failures use codes like CONTENT_POLICY_VIOLATION, TASK_FAILED, and TASK_TIMEOUT; failed tasks refund in full.
Before you ship
- Callbacks: pass
"callback": {"url": "https://..."}at the request top level and HiAPI notifies your service at the terminal state. - Persist outputs:
output[0].urlis temporary — download it into your own storage right away. - Be explicit about aspect:
aspect_ratiois required; pick 9:16 deliberately for vertical social content. - Seed types differ by tier: Fast takes an integer, standard and Ultra take strings — convert when reusing a composition across tiers.
FAQ
- Yes, all three models share one calling convention — change only the
modelfield. - No, there are no pixel-size or format parameters.
aspect_ratiosets the frame; each call returns one image. - Yes, failures are free. Credits held at creation are refunded in full at the terminal failure state.
- Yes, zoom in on rendered text. Poster-style images occasionally gain or lose a letter — inspect the lettering at full size before publishing.
Next: copy the living-room prompt above and generate a test image, then batch-produce from the scene templates in the prompt guide.





