Task Management
Create Prediction
Submit asynchronous image, video, or audio prediction tasks via POST /v1/predictions.
POST
Common request body
All capabilities share the following top-level fields. The shape ofinput varies by function.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID as shown on each model page (may follow <provider>/<model-name>). |
function | string | Yes | Task type: image (image), video (video), or audio (audio). |
input | object | Yes | Input parameters for the selected function. See sections below. |
webhook | string | No | HTTPS URL for server callbacks on task status or result updates (e.g. https://api.shuyou.ai/api/callback). |
Image generation (function: image)
Use for text-to-image, reference-image generation, and similar scenarios. The following fields are inside the input object.
Text prompt describing the image to generate.
Aspect ratio such as
1:1, 16:9, or 9:16. Supported values depend on the selected model.Output resolution tier such as
1K or 2K. Supported values depend on the selected model.Reference or input image URL list (string array) for image-to-image or style reference. Pass
[] when not needed.Number of images to generate. Default
1. Actual limit depends on model and quota.Output encoding such as
png, jpeg, or webp. Uses platform or model default when omitted.Video generation (function: video)
Use for text-to-video and related scenarios. The following fields are inside the input object. Supported resolution tiers, duration options, and other values vary by model.
Text prompt describing video content and camera motion.
Aspect ratio such as
16:9, 9:16, or 1:1. Supported values depend on the selected model.Output resolution tier such as
720P or 1080P. Supported values depend on the selected model.Video duration, usually passed as a string seconds value or model-specific enum (e.g.
"4" for 4 seconds). Supported values vary by model.Audio generation (function: audio)
Audio input fields (voice, speed, sample rate, etc.) vary by model. Parameter details and examples will be added in a future release. Refer to the corresponding model page or console documentation when integrating.
data.task_id.Authorizations
Authorization: Bearer YOUR_API_KEY
Body
application/json
Model ID as shown on each model page (may follow <provider>/<model-name>).
Example:
"gemini-2.5-flash-image"
Task type: image, video, or audio.
Available options:
image, video, audio Example:
"image"
Input parameters for the selected function. See model pages for supported fields.
- Option 1
- Option 2
- Option 3
Optional HTTPS callback URL when task status or results update.
Example:
"https://api.shuyou.ai/api/callback"
Response
Async task created