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

Text-to-Video

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

Request Body

application/json

_action*string

Fixed value t2v

model?string

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

prompt?string

Prompt, maximum length 2048 characters

negativePrompt?string

Negative prompt, used to describe elements that should not appear in the generated image.

duration?integer

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

resolution?string

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

aspectRatio?string

Aspect ratio, supported: 16:9, 9:16, 1:1, 4:3, 3:4

motionMode?string

Generation mode, default: normal. aisphere-v3.5 ~ 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, supports: anime, 3d_animation, clay, comic, cyberpunk

seed?integer

Random Seed

soundEffectSwitch?boolean

Whether to enable background music (not supported by the aisphere-v5.5 model), default false

soundEffectContent?string

Background music type (not supported by the aisphere-v5.5 model), automatically matched by default, supports string input, e.g., birdsong

cameraMovement?string

Camera movement parameters (supported only by the aisphere-v4.5 model), supporting: horizontal_left: horizontal movement to the left, horizontal_right: horizontal movement to the right, vertical_up: vertical upward movement, vertical_down: vertical downward movement, zoom_in: zoom in and enlarge the frame, zoom_out: zoom out and shrink the frame, crane_up: rise from a low angle, quickly_zoom_in: quick zoom in, quickly_zoom_out: quick zoom out, smooth_zoom_in: smooth zoom in, camera_rotation: rotate around an axis, robo_arm: complex movement using a robotic arm, super_dolly_out: rapid backward dolly, whip_pan: rapid horizontal pan creating motion blur, hitchcock: simultaneous zoom and dolly to change background perspective, left_follow: follow subject to the left, right_follow: follow subject to the right, pan_left: horizontal pan to the left from a fixed position, pan_right: horizontal pan to the right from a fixed position, fix_bg: keep background fixed during movement.

generateAudioSwitch?boolean

Audio control switch (only supported by the aisphere-v5.5 model) true: Audio on false: Audio off

generateMultiClipSwitch?boolean

Controls single-shot and multi-shot (supported only by the aisphere-v5.5 model), true: multi-shot, false: single-shot

thinkingType?string

Whether to use the system prompt optimization feature (supported only by the 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

Image Count

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