Image-to-Video
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Fixed value i2v
Model name, supported: aisphere-v5.5, aisphere-v5, aisphere-v4.5, aisphere-v4, aisphere-v3.5
Image information, required for pure image-to-video generation.
Image Link
First and last frame image information, required for first and last frame generation.
First Frame Image Information
Image Link
Last Frame Image Information
Image Link
Reference image information, required for reference-based video generation (supported only by aisphere-v4.5 and aisphere-v5). Each element contains an imageUrl field.
Image Link
Must be one of "subject" or "background"
Subject/background names can be enclosed in curly braces {} in the reference generation prompt, for example: {person1} talking to {person2}.
Prompt, maximum length 2048 characters
Negative Prompt
Video duration, unit: s. aisphere-v3.5 ~ v5 supports: 5, 8. aisphere-v5.5 supports: 5, 8, 10.
Video resolution, supported: 360p, 540p, 720p, 1080p
Generation mode, default is normal. aisphere-v3.5 to v4.5 support: normal, fast. aisphere-v5 and v5.5 only support normal (fast is only available when duration=5, and resolution=1080p does not support fast).
Style, supported values: anime, 3d_animation, clay, comic, cyberpunk, normal (normal is only supported by aisphere-v5.5; style configuration is not supported for video generation from first and last frames)
Random Seed
Whether to enable background music, default is false (supported in aisphere-v3.5 to v5, not supported in aisphere-v5.5)
Background music type, automatically matched by default, accepts string input such as birdsong (supported in aisphere-v3.5 ~ v5, not supported in aisphere-v5.5)
Camera movement parameters (aisphere-v4, aisphere-v4.5 models), optional, supported: horizontal_left: move horizontally left; horizontal_right: move horizontally right; vertical_up: move vertically up; vertical_down: move vertically down; zoom_in: zoom in to enlarge the frame; zoom_out: zoom out to shrink the frame; crane_up: rise from a low position; quickly_zoom_in: quickly zoom in; quickly_zoom_out: quickly zoom out; smooth_zoom_in: smoothly zoom in; camera_rotation: rotate around an axis; robo_arm: use a robotic arm for complex movements; super_dolly_out: quickly dolly out; whip_pan: quickly pan horizontally to create motion blur; hitchcock: simultaneously zoom and dolly to alter background perspective; left_follow: follow the subject to the left; right_follow: follow the subject to the right; pan_left: pan horizontally left from a fixed position; pan_right: pan horizontally right from a fixed position; fix_bg: keep the background fixed during movement.
Audio control switch (aisphere-v5.5 model), optional. true: Audio on, false: Audio off
Controls single-shot and multi-shot (aisphere-v5.5 model), optional. true: multi-shot, false: single-shot.
Whether to use the system prompt optimization feature (aisphere-v5.5 model), optional. "enabled": on, "disabled": off. "auto" or omitted: let the model decide automatically.
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Number of Images
Video Duration in Seconds
Input Token Count
Total Tokens
Output Token Count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/video/generation" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "_action": "string", "model": "string", "image": { "imageUrl": "string" }, "headtailImages": {}, "characterImages": [ { "imageUrl": "string", "type": "string", "refName": "string" } ] }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}