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

Video Generation 3.0 Pro

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

Region*string

Fixed values for this service: Region is cn-north-1, Service is cv.

Service*string

Fixed values for this service: Region is cn-north-1, Service is cv.

Request Body

application/json

model*string

Model name, use the fixed value: jimeng_ti2v_v30_pro

Value in"jimeng_ti2v_v30_pro"
req_key*string

Model name, use the fixed value: jimeng_ti2v_v30_pro

prompt?string

Prompts for video generation; both Chinese and English are supported. It is recommended to keep the prompt under 400 characters and no more than 800 characters, as excessively long prompts may lead to abnormal results or fail to take effect.

binary_data_base64?array<string>

Base64-encoded image file, only 1 image input is supported (image-to-video only supports passing the first frame), and only JPEG and PNG formats are supported; Note: Image file size: maximum 4.7MB; Image resolution: maximum 4096 * 4096, shortest side no less than 320; The ratio of the long side to the short side of the image must be within 3; For image-to-video scenarios, either an image or a prompt is required; When uploading an image, choose either the binary_data_base64 or image_urls parameter.

[]?string
image_urls?array<string>

Image file URL; only one image is supported (for image-to-video, only the first frame is supported). Note: The ratio of the image's long side to short side must not exceed 3; for image-to-video scenarios, either an image or a prompt is required; when uploading an image, either the binary_data_base64 or image_urls parameter must be specified.

[]?string
seed?integer

Random seed, which serves as the basis for determining the initial state of diffusion, defaults to -1 (random). If the same positive integer is used as the random seed and all other parameters are identical, the generated videos will most likely yield consistent results. Default: -1

frames?integer

Total number of generated frames (frames = 24 * n + 1, where n is the duration in seconds, supporting 5s and 10s). Allowed values: [121, 241]. Default value: 121.

aspect_ratio?string

Aspect ratio of the generated video, which only takes effect in text-to-video scenarios; in image-to-video scenarios, the closest ratio is selected from the available options based on the aspect ratio of the input image. Available options: ["16:9", "4:3", "1:1", "3:4", "9:16", "21:9"]. Default value: "16:9". The correspondence between the generated video dimensions and aspect ratios is as follows: 2176 * 928 (21:9), 1920 * 1088 (16:9), 1664 * 1248 (4:3), 1440 * 1440 (1:1), 1248 * 1664 (3:4), 1088 * 1920 (9:16).

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 "Region: string" \  -H "Service: string" \  -H "Content-Type: application/json" \  -d '{    "model": "jimeng_ti2v_v30_pro",    "req_key": "jimeng_ti2v_v30_pro"  }'
{
  "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"
}