Skip to main content
POST
/
imagen-4.0-generate-001
/
async
curl --request POST \
  --url https://api.modellix.ai/api/v1/google/imagen-4.0-generate-001/async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A golden retriever playing fetch on the beach at sunset"
}
'
{
  "code": 0,
  "message": "success",
  "data": {
    "status": "pending",
    "task_id": "task-jkl012",
    "model_id": "google/imagen-4.0-generate-001",
    "get_result": {
      "method": "GET",
      "url": "https://api.modellix.ai/api/v1/tasks/task-jkl012"
    }
  }
}

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json
prompt
string
required

Image description text

Minimum string length: 1
Example:

"A golden retriever playing fetch on the beach at sunset"

sampleCount
integer
default:1

Number of images to generate per request

Required range: 1 <= x <= 4
Example:

1

aspectRatio
enum<string>
default:1:1

Image aspect ratio

Available options:
1:1,
3:4,
4:3,
9:16,
16:9
Example:

"16:9"

personGeneration
enum<string>
default:dont_allow

Person generation policy

Available options:
dont_allow,
allow_adult,
allow_all
Example:

"dont_allow"

imageSize
enum<string>

Output image resolution

Available options:
1K,
2K
Example:

"1K"

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required