Imagen 4 API
Google's Imagen 4: text to image.
Pricing per image
| Size | Per image |
|---|---|
| All settings | $0.055 credits |
Billed in credits per image (100 credits = $1, rounded up to a whole credit). Charged once, only for the route that succeeds. Failed attempts cost $0.00.
Request
# One Idempotency-Key per request, made once and sent again with every resend of it
KEY=$(uuidgen)
# 1. Submit. max_cost_usd is your cap: the most this may cost (it lists at $0.05).
# No id after a timeout, a 429 or a 5xx? Run step 1 again: the same $KEY never makes a second one.
RESP=$(curl -s https://api.revana.si/v1/generations \
-H "Authorization: Bearer $REVANA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $KEY" \
-d '{
"model": "imagen-4",
"input": {
"prompt": "A product photo of a ceramic coffee cup on a linen tablecloth, soft morning light",
"aspect_ratio": "16:9"
},
"max_cost_usd": 0.08
}')
ID=$(echo "$RESP" | jq -r '.id // empty')
echo "${ID:-no id: ${RESP:-no answer}}"
# 2. Poll it until status is "succeeded" or "failed". A failed one is free; to try it again,
# make a new key first (KEY=$(uuidgen)): the old one answers with the failure.
curl -s https://api.revana.si/v1/generations/${ID:?no id from step 1} \
-H "Authorization: Bearer $REVANA_API_KEY"
# 3. Download the file once it has succeeded
curl -L https://api.revana.si/v1/generations/${ID:?no id from step 1}/content \
-H "Authorization: Bearer $REVANA_API_KEY" \
-o out.pngSet REVANA_API_KEY to your key. Full reference in the quickstart.
Options
imagen-42 routes
Every request starts on the cheapest route. If it fails, the job moves to the next one automatically.
About the Imagen 4 API
How much does the Imagen 4 API cost?
Imagen 4 costs $0.05 per image on Revana. You pay in prepaid credits, 100 credits to the dollar, with no subscription or monthly minimum. A generation that fails costs nothing.
How do I call Imagen 4 from code?
Send POST https://api.revana.si/v1/generations with {"model": "imagen-4", "input": {...}} and your Revana API key as a Bearer token, poll GET /v1/generations/{id} until it succeeds, then download GET /v1/generations/{id}/content. Every model on Revana takes the same request shape.
What happens if a Imagen 4 generation fails?
Revana has 2 routes for Imagen 4. A job starts on the cheapest and moves to the next automatically if one fails. You are charged once, only for the route that delivers. A failed generation costs $0.00.
What can Imagen 4 do on Revana?
Imagen 4 supports text to image and aspect ratios 1:1, 4:3, 3:4, 16:9, 9:16. A value it does not offer is refused with 422 before anything is charged.
Can my AI agent use Imagen 4?
Yes. Connect the Revana MCP server (https://revana.si/api/mcp) to Claude, ChatGPT, Cursor or Codex, or have the agent call the REST API. The agent can list models, get a free quote and generate on your credits.
Guides
- Try Imagen 4 online
- The Best AI Image Generation API in 2026, by Use Case
- Midjourney Alternatives: 8 Image APIs, Priced per Image
Compare with similar models
- Nano Banana Pro Google, from $0.04 per image
- Nano Banana 2 Google, from $0.03 per image
- Nano Banana Google, from $0.03 per image
- Imagen 4 Fast Google, from $0.03 per image
- Imagen 4 Ultra Google, from $0.08 per image
- Nano Banana 2 Lite Google, from $0.02 per image
Also as markdown for agents. Every model and price: models.json.