Skip to main content
POST
/
jobs
/
createTask
Create Task
curl --request POST \
  --url https://api.example.com/jobs/createTask \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "callBackUrl": "<string>",
  "input": {}
}
'

Endpoint

POST https://api.kie.ai/api/v1/jobs/createTask

Request Body

model
string
required
The model to use for generation (e.g., google/imagen4, z-image)
callBackUrl
string
URL to receive webhook notification when task completes
input
object
required
Model-specific input parameters

Example Request

curl --request POST \
  --url https://api.kie.ai/api/v1/jobs/createTask \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "google/imagen4",
    "callBackUrl": "https://your-domain.com/api/callback",
    "input": {
      "prompt": "A beautiful sunset over the ocean",
      "aspect_ratio": "16:9"
    }
  }'

Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_xxxxx"
  }
}