{
"model": "gemini-2.5-flash-image",
"input": {
"prompt": "Generate a ShuYou AI logo",
"aspect_ratio": "1:1",
"resolution": "1K",
"image_urls": [],
"num_images": 1,
"output_format": "png"
},
"webhook": "https://api.shuyou.ai/api/callback"
}
{
"data": {
"task_id": "2c4d50261173430290971a2395a3b607",
"task_status": "processing"
}
}
Task Management
Create Prediction
Submit asynchronous image, video, or audio prediction tasks via POST /v1/predictions.
POST
/
v1
/
predictions
{
"model": "gemini-2.5-flash-image",
"input": {
"prompt": "Generate a ShuYou AI logo",
"aspect_ratio": "1:1",
"resolution": "1K",
"image_urls": [],
"num_images": 1,
"output_format": "png"
},
"webhook": "https://api.shuyou.ai/api/callback"
}
{
"data": {
"task_id": "2c4d50261173430290971a2395a3b607",
"task_status": "processing"
}
}
Common request body
All capabilities share the following top-level fields. The shape ofinput varies by model.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID as shown on each model page (may follow <provider>/<model-name>). |
input | object | Yes | Input parameters for the selected model. 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
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.Different models may support different subsets of these fields. See each model page for details. Unsupported fields may be ignored or return a parameter error.
{
"model": "gemini-2.5-flash-image",
"input": {
"prompt": "Generate a ShuYou AI logo",
"aspect_ratio": "1:1",
"resolution": "1K",
"image_urls": [],
"num_images": 1,
"output_format": "png"
},
"webhook": "https://api.shuyou.ai/api/callback"
}
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.If a field is invalid for the current model, it may be ignored or trigger a validation error. Extended fields (such as first-frame image URLs) are documented on each model page.
{
"model": "veo-3.1-lite-generate-preview",
"input": {
"prompt": "A cinematic shot of a majestic lion in the savannah.",
"aspect_ratio": "16:9",
"resolution": "720P",
"duration": "4"
},
"webhook": "https://api.shuyou.ai/api/callback"
}
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": "2c4d50261173430290971a2395a3b607",
"task_status": "processing"
}
}
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
Show child attributes
Show child attributes
Optional HTTPS callback URL when task status or results update.
Example:
"https://api.shuyou.ai/api/callback"
Response
Async task created
Show child attributes
Show child attributes