Skip to main content
POST
/
v1
/
predictions
{
  "model": "gemini-2.5-flash-image",
  "function": "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 of input varies by function.
FieldTypeRequiredDescription
modelstringYesModel ID as shown on each model page (may follow <provider>/<model-name>).
functionstringYesTask type: image (image), video (video), or audio (audio).
inputobjectYesInput parameters for the selected function. See sections below.
webhookstringNoHTTPS 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.
input.prompt
string
required
Text prompt describing the image to generate.
input.aspect_ratio
string
Aspect ratio such as 1:1, 16:9, or 9:16. Supported values depend on the selected model.
input.resolution
string
Output resolution tier such as 1K or 2K. Supported values depend on the selected model.
input.image_urls
array
Reference or input image URL list (string array) for image-to-image or style reference. Pass [] when not needed.
input.num_images
integer
Number of images to generate. Default 1. Actual limit depends on model and quota.
input.output_format
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",
  "function": "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 (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.
input.prompt
string
required
Text prompt describing video content and camera motion.
input.aspect_ratio
string
Aspect ratio such as 16:9, 9:16, or 1:1. Supported values depend on the selected model.
input.resolution
string
Output resolution tier such as 720P or 1080P. Supported values depend on the selected model.
input.duration
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",
  "function": "video",
  "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 (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": "2c4d50261173430290971a2395a3b607",
    "task_status": "processing"
  }
}
Poll task status with Get a prediction using data.task_id.

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_KEY

Body

application/json
model
string
required

Model ID as shown on each model page (may follow <provider>/<model-name>).

Example:

"gemini-2.5-flash-image"

function
enum<string>
required

Task type: image, video, or audio.

Available options:
image,
video,
audio
Example:

"image"

input
object
required

Input parameters for the selected function. See model pages for supported fields.

webhook
string<uri>

Optional HTTPS callback URL when task status or results update.

Example:

"https://api.shuyou.ai/api/callback"

Response

Async task created

data
object
required