Google Imagen4 API reference
Check Google Imagen4 availability, inputs, parameters, file requirements, credit pricing, and request examples for Rivya Public API v1. Model ID: google-imagen4.
google-imagen4
text
Not required for the minimal request
Credit rate: 8 per request The final cost is rounded up to whole credits.
Image
FIXED
5000 characters
Request fields
Set model at the top level. Put model-specific controls and reference inputs in params, using the format documented for this model.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | google-imagen4 | Set model to google-imagen4. |
| prompt | string | Yes | - | Maximum 5000 characters for this model. |
| params | object | No | - | The model-specific params object. Use the documented keys and reference-file format for this model. |
| client_request_id | string | No | - | Optional ID for tracing this request in your system. It does not replace Idempotency-Key. |
Model parameters
| Key | Type | Required | Default | Range | Options | Description |
|---|---|---|---|---|---|---|
| aspect_ratio | select | No | 1:1 | - | 1:1, 16:9, 9:16, 3:4, 4:3, auto | Aspect ratio |
| negative_prompt | text | No | - | - | - | Negative prompt |
| seed | text | No | - | - | - | Keep the prompt, reference inputs, and settings unchanged when reusing a seed. Allowed seed values and defaults depend on the model, and identical results are not guaranteed. |
Minimal request
{
"model": "google-imagen4",
"prompt": "A product bottle on a light gray background, lit softly from the left.",
"params": {
"aspect_ratio": "1:1",
"negative_prompt": "Optional things to avoid",
"seed": "Optional seed text"
}
}Example response
An accepted generation request returns a task ID. Poll the status endpoint until the task succeeds or fails. A status request failure does not mean generation failed.
{
"id": "task_google_imagen4_example",
"status": "queued",
"model": "google-imagen4",
"reserved_credits": 8,
"final_credits": 0,
"settlement_status": "RESERVED",
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
An accepted generation request returns a task ID. Poll the status endpoint until the task succeeds or fails. A status request failure does not mean generation failed.
