即梦官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31' \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body视频系列
即梦官方接口
即梦(Jimeng)视频生成官方接口
POST
{llmApiOrigin}
/
jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31
即梦官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31' \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body简介
即梦官方接口与即梦(Jimeng)火山引擎官方协议对齐,使用Action 查询参数区分提交与查询,请求体为即梦官方字段风格,通过即梦渠道分发。
端点:
POST https://https://api.gzyzhuai.com/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31 # 提交
POST https://https://api.gzyzhuai.com/jimeng?Action=CVSync2AsyncGetResult&Version=2022-08-31 # 查询
Action查询参数必填;Version与服务端一致(2022-08-31)。整个请求体是 JSON。
认证
string
必填
Bearer Token,如
Bearer sk-xxxxxxxxxx支持模型
req_key 即模型标识,当前支持:jimeng_vgfm_t2v_l20(文生视频)。
提交任务
POST/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31
文生视频
curl -X POST "https://api.gzyzhuai.com/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31" \
-H "Authorization: Bearer sk-xxxx" \
-H "Content-Type: application/json" \
-d '{
"req_key": "jimeng_vgfm_t2v_l20",
"prompt": "一只毛茸茸的小猫在雪地里打滚"
}'
图生视频(首帧)
curl -X POST "https://api.gzyzhuai.com/jimeng?Action=CVSync2AsyncSubmitTask&Version=2022-08-31" \
-H "Authorization: Bearer sk-xxxx" \
-H "Content-Type: application/json" \
-d '{
"req_key": "jimeng_vgfm_t2v_l20",
"prompt": "人物微微一笑,镜头缓慢拉近",
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}'
请求参数
以下为即梦官方风格字段:| 字段 | 类型 | 说明 |
|---|---|---|
req_key | string | 即梦模型标识(必填),如 jimeng_vgfm_t2v_l20 |
prompt | string | 提示词 |
image | string | 图生视频输入(URL 或 Base64,或带 data: 的图片) |
image_urls | array | 多图输入(参考图/首尾帧) |
binary_data_base64 | array | 图片二进制 Base64 数组 |
seed | integer | 随机种子 |
aspect_ratio | string | 画幅比例 |
frames | integer | 帧数 |
Action查询参数必填,缺少会返回 400。Version固定2022-08-31可省略按服务端默认处理。
提交响应
{
"code": 10000,
"message": "success",
"data": { "task_id": "task_1234567890" }
}
data.task_id 是后续查询用的任务 ID。
查询任务
POST/jimeng?Action=CVSync2AsyncGetResult&Version=2022-08-31
curl -X POST "https://api.gzyzhuai.com/jimeng?Action=CVSync2AsyncGetResult&Version=2022-08-31" \
-H "Authorization: Bearer sk-xxxx" \
-H "Content-Type: application/json" \
-d '{
"req_key": "jimeng_vgfm_t2v_l20",
"task_id": "task_1234567890"
}'
查询响应
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 10000 表示成功 |
data.status | string | 任务状态(见下表) |
data.video_url | string | 完成时视频地址 |
message / request_id | string | 提示信息 / 请求 ID |
| 状态 | 说明 |
|---|---|
| 排队中/生成中 | PENDING、RUNNING |
| 成功 | SUCCESS |
| 失败 | FAILED |
具体状态枚举以即梦官方为准;请以 data.status 判断任务是否完成,不要只判断 HTTP 状态码。
相关页面
视频生成总览
异步流程与入口选择
视频内容获取
下载与代理获取视频文件
