Theme
Create Task google/imagen-4
POST
https://www.kkiai.com/replicate/v1/models/google/imagen-4/predictions
Official documentation: https://replicate.com/google/imagen-4
Request Parameters
Authorization
Add the Authorization parameter to the Header, with the value being the Token concatenated after Bearer
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
input | object | Optional | |
└ prompt | string | Required | Text prompt for image generation. |
└ aspect_ratio | string | Optional | Aspect ratio of the generated image. Default value: "1:1". Supported: 1:1, 9:16, 16:9, 3:4, 4:3 |
└ output_format | string | Optional | Format of the output image. Default value: "jpg". |
└ safety_filter_level | string | Optional | block_low_and_above is the strictest, block_medium_and_above will block some prompts, block_only_high is the most lenient, but some prompts will still be blocked. Default value: "block_only_high" |
Request Example
json
{
"input": {
"prompt": "The photo: Create a cinematic, photorealistic medium shot capturing the nostalgic warmth of a late 90s indie film. The focus is a young woman with brightly dyed pink-gold hair and freckled skin, looking directly and intently into the camera lens with a hopeful yet slightly uncertain smile, she is slightly off-center. She wears an oversized, vintage band t-shirt that says \"Replicate\" (slightly worn) over a long-sleeved striped top and simple silver stud earrings. The lighting is soft, golden hour sunlight streaming through a slightly dusty window, creating lens flare and illuminating dust motes in the air. The background shows a blurred, cluttered bedroom with posters on the wall and fairy lights, rendered with a shallow depth of field. Natural film grain, a warm, slightly muted color palette, and sharp focus on her expressive eyes enhance the intimate, authentic feel",
"aspect_ratio": "16:9",
"output_format": "jpg",
"safety_filter_level": "block_medium_and_above"
}
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/replicate/v1/models/google/imagen-4/predictions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": {
"prompt": "The photo: Create a cinematic, photorealistic medium shot capturing the nostalgic warmth of a late 90s indie film. The focus is a young woman with brightly dyed pink-gold hair and freckled skin, looking directly and intently into the camera lens with a hopeful yet slightly uncertain smile, she is slightly off-center. She wears an oversized, vintage band t-shirt that says \"Replicate\" (slightly worn) over a long-sleeved striped top and simple silver stud earrings. The lighting is soft, golden hour sunlight streaming through a slightly dusty window, creating lens flare and illuminating dust motes in the air. The background shows a blurred, cluttered bedroom with posters on the wall and fairy lights, rendered with a shallow depth of field. Natural film grain, a warm, slightly muted color palette, and sharp focus on her expressive eyes enhance the intimate, authentic feel",
"aspect_ratio": "16:9",
"output_format": "jpg",
"safety_filter_level": "block_medium_and_above"
}
}'Response
🟢 200 Success
Response Body
| Parameter Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | |
model | string | Required | |
version | string | Required | |
input | object | Required | |
└ aspect_ratio | string | Required | |
└ output_format | string | Required | |
└ prompt | string | Required | |
└ safety_filter_level | string | Required | |
logs | string | Required | |
output | null | Required | |
data_removed | boolean | Required | |
error | null | Required | |
status | string | Required | |
created_at | string | Required | |
urls | object | Required | |
└ cancel | string | Required | |
└ get | string | Required | |
└ stream | string | Required | |
└ web | string | Required |
Response Example
json
{
"id": "yj1hjjc3c5rme0crb5jtqtxxmw",
"model": "google/imagen-4",
"version": "hidden",
"input": {
"aspect_ratio": "16:9",
"output_format": "jpg",
"prompt": "The photo: Create a cinematic, photorealistic medium shot capturing the nostalgic warmth of a late 90s indie film. The focus is a young woman with brightly dyed pink-gold hair and freckled skin, looking directly and intently into the camera lens with a hopeful yet slightly uncertain smile, she is slightly off-center. She wears an oversized, vintage band t-shirt that says \"Replicate\" (slightly worn) over a long-sleeved striped top and simple silver stud earrings. The lighting is soft, golden hour sunlight streaming through a slightly dusty window, creating lens flare and illuminating dust motes in the air. The background shows a blurred, cluttered bedroom with posters on the wall and fairy lights, rendered with a shallow depth of field. Natural film grain, a warm, slightly muted color palette, and sharp focus on her expressive eyes enhance the intimate, authentic feel",
"safety_filter_level": "block_medium_and_above"
},
"logs": "",
"output": null,
"data_removed": false,
"error": null,
"status": "starting",
"created_at": "2025-07-30T03:34:41.761Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/yj1hjjc3c5rme0crb5jtqtxxmw/cancel",
"get": "https://api.replicate.com/v1/predictions/yj1hjjc3c5rme0crb5jtqtxxmw",
"stream": "https://stream.replicate.com/v1/files/bcwr-wzn4sniemyumrzyhr364uivh625z7wk5w2qlbvbzqci3lgvzhwrq",
"web": "https://replicate.com/p/yj1hjjc3c5rme0crb5jtqtxxmw"
}
}