SiliconFlow

创建视频生成请求

Generate a video through the input prompt. This API returns the user's current request ID. The user needs to poll the status interface to get the specific video link. The generated result is valid for 10 minutes, so please retrieve the video link promptly.

POST
/video/submit
AuthorizationBearer <token>required

Use the following format for authentication: Bearer

In: header

modelstringrequired

Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible. For a complete list of available models, please check the Models.

Value in"Wan-AI/Wan2.2-I2V-A14B" | "Wan-AI/Wan2.2-T2V-A14B"
Example"Wan-AI/Wan2.2-I2V-A14B"
promptstringrequired

The text prompt to generate the video description from.

negative_promptstring

negative prompt

image_sizestringrequired

Length-width ratio of the generated image.

Value in"1280x720" | "720x1280" | "960x960"
imageUpload Image

When selecting the model Wan-AI/Wan2.2-I2V-14B-720P, the image parameter is a required field.

Value in"data:image/png;base64, XXX" | "img_url"
Example"https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641"
seedinteger

The seed for the random number generator.

Response Body

const body = JSON.stringify({
  "model": "Wan-AI/Wan2.2-I2V-A14B",
  "prompt": "string",
  "image_size": "1280x720"
})

fetch("https://api.siliconflow.cn/v1/video/submit", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.siliconflow.cn/v1/video/submit"
  body := strings.NewReader(`{
    "model": "Wan-AI/Wan2.2-I2V-A14B",
    "prompt": "string",
    "image_size": "1280x720"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.siliconflow.cn/v1/video/submit"
body = {
  "model": "Wan-AI/Wan2.2-I2V-A14B",
  "prompt": "string",
  "image_size": "1280x720"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "model": "Wan-AI/Wan2.2-I2V-A14B",
  "prompt": "string",
  "image_size": "1280x720"
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://api.siliconflow.cn/v1/video/submit"))
  .header("Content-Type", "application/json")
  .POST(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "model": "Wan-AI/Wan2.2-I2V-A14B",
  "prompt": "string",
  "image_size": "1280x720"
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://api.siliconflow.cn/v1/video/submit", body);
var responseBody = await response.Content.ReadAsStringAsync();
curl --request POST \
  --url https://api.siliconflow.cn/v1/video/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "Wan-AI/Wan2.2-I2V-A14B",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "image_size": "1280x720",
  "image": "https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641",
  "seed": 123
}'
import requests

url = "https://api.siliconflow.cn/v1/video/submit"

payload = {
    "model": "Wan-AI/Wan2.2-I2V-A14B",
    "prompt": "<string>",
    "negative_prompt": "<string>",
    "image_size": "1280x720",
    "image": "https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641",
    "seed": 123
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"Wan-AI/Wan2.2-I2V-A14B","prompt":"<string>","negative_prompt":"<string>","image_size":"1280x720","image":"https://inews.gtimg.com/om_bt/Os3eJ8u3SgB3Kd-zrRRhgfR5hUvdwcVPKUTNO6O7sZfUwAA/641","seed":123}'
};

fetch('https://api.siliconflow.cn/v1/video/submit', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
{
  "requestId": "string"
}
{
  "code": 20012,
  "message": "string",
  "data": "string"
}
"Invalid token"
"Forbidden"
"404 page not found"
{
  "message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn. Details:TPM limit reached.",
  "data": "string"
}
{
  "code": 50505,
  "message": "Model service overloaded. Please try again later.",
  "data": "string"
}
"string"