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 model.
Image generation
Use for text-to-image, reference-image generation, and similar scenarios. The following fields are inside theinput object.
string
required
Text prompt describing the image to generate.
string
Aspect ratio such as
1:1, 16:9, or 9:16. Supported values depend on the selected model.string
Output resolution tier such as
1K or 2K. Supported values depend on the selected model.array
Reference or input image URL list (string array) for image-to-image or style reference. Pass
[] when not needed.integer
Number of images to generate. Default
1. Actual limit depends on model and quota.string
Output encoding such as
png, jpeg, or webp. Uses platform or model default when omitted.Video generation
Use for text-to-video and related scenarios. The following fields are inside theinput object. Supported resolution tiers, duration options, and other values vary by model.
string
required
Text prompt describing video content and camera motion.
string
Aspect ratio such as
16:9, 9:16, or 1:1. Supported values depend on the selected model.string
Output resolution tier such as
720P or 1080P. Supported values depend on the selected model.string
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
Audioinput 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"
Input parameters for the selected model. 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