Skip to main content
POST
/
v1
/
predictions
curl --request POST \
  --url https://api.shuyou.ai/v1/predictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-image-2",
  "function": "image",
  "input": {
    "prompt": "A vivid, colorful sunset over the ocean"
  }
}
'
{
  "data": {
    "task_id": "2c4d50261173430290971a2395a3b607",
    "task_status": "processing"
  }
}

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_KEY

Body

application/json
model
enum<string>
default:gpt-image-2
required

Model ID. Use gpt-image-2 for this endpoint.

Available options:
gpt-image-2
Example:

"gpt-image-2"

function
enum<string>
required

Task type. Must be image for image generation.

Available options:
image
Example:

"image"

input
object
required
webhook
string<uri>

Optional HTTPS callback URL when the task completes, fails, or is cancelled (Predictions API).

Response

Async task created

data
object
required