典名词元DMTOKENSHome
API DocumentationThird-Party Tools Tutorial
AI Model APIVideoAiSphere

Image-to-Video

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

Request Body

application/json

_action*string

Fixed value i2v

model*string

Model name, supported: aisphere-v5.5, aisphere-v5, aisphere-v4.5, aisphere-v4, aisphere-v3.5

image*object

Image information, required for pure image-to-video generation.

imageUrl*string

Image Link

headtailImages*object

First and last frame image information, required for first and last frame generation.

headImage?object

First Frame Image Information

imageUrl?string

Image Link

tailImage?object

Last Frame Image Information

imageUrl?string

Image Link

characterImages*array<object>

Reference image information, required for reference-based video generation (supported only by aisphere-v4.5 and aisphere-v5). Each element contains an imageUrl field.

[]?object
imageUrl*string

Image Link

type*string

Must be one of "subject" or "background"

refName*string

Subject/background names can be enclosed in curly braces {} in the reference generation prompt, for example: {person1} talking to {person2}.

prompt?string

Prompt, maximum length 2048 characters

negativePrompt?string

Negative Prompt

duration?integer

Video duration, unit: s. aisphere-v3.5 ~ v5 supports: 5, 8. aisphere-v5.5 supports: 5, 8, 10.

resolution?string

Video resolution, supported: 360p, 540p, 720p, 1080p

motionMode?string

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?string

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)

seed?integer

Random Seed

soundEffectSwitch?boolean

Whether to enable background music, default is false (supported in aisphere-v3.5 to v5, not supported in aisphere-v5.5)

soundEffectContent?string

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)

cameraMovement?string

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.

generateAudioSwitch?boolean

Audio control switch (aisphere-v5.5 model), optional. true: Audio on, false: Audio off

generateMultiClipSwitch?boolean

Controls single-shot and multi-shot (aisphere-v5.5 model), optional. true: multi-shot, false: single-shot.

thinkingType?string

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.

code*integer

Status Code

data*object

Data Object

urls*array<string>

Result Set

[]?string
usage*object

Usage Information

images*integer

Number of Images

seconds*integer

Video Duration in Seconds

input_tokens*integer

Input Token Count

total_tokens*integer

Total Tokens

output_tokens*integer

Output Token Count

expired*string

Validity Period

task_id*string

Task ID

task_status*string

Task Status

message*string

Status Information

request_id*string

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"
}