提交图片生成任务
curl --request POST \
--url https://api.keevx.cn/v1/image_generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A serene mountain lake at sunset with golden reflections",
"reference_images": [
"https://example.com/ref.jpg"
],
"module": "std",
"generate_count": 2,
"image_quality": "2K",
"image_ratio": "16:9"
}
'import requests
url = "https://api.keevx.cn/v1/image_generate"
payload = {
"prompt": "A serene mountain lake at sunset with golden reflections",
"reference_images": ["https://example.com/ref.jpg"],
"module": "std",
"generate_count": 2,
"image_quality": "2K",
"image_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A serene mountain lake at sunset with golden reflections',
reference_images: ['https://example.com/ref.jpg'],
module: 'std',
generate_count: 2,
image_quality: '2K',
image_ratio: '16:9'
})
};
fetch('https://api.keevx.cn/v1/image_generate', 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.keevx.cn/v1/image_generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A serene mountain lake at sunset with golden reflections',
'reference_images' => [
'https://example.com/ref.jpg'
],
'module' => 'std',
'generate_count' => 2,
'image_quality' => '2K',
'image_ratio' => '16:9'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.keevx.cn/v1/image_generate"
payload := strings.NewReader("{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.keevx.cn/v1/image_generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keevx.cn/v1/image_generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "ok",
"data": {
"task_ids": [
"i2is-a1b2c3d4e5f6",
"i2is-g7h8i9j0k1l2"
]
}
}图片创作
创建图片创作任务
根据文本提示词和可选的参考图片,生成一张或多张 AI 图片。返回任务 ID 列表用于轮询查询。
POST
/
v1
/
image_generate
提交图片生成任务
curl --request POST \
--url https://api.keevx.cn/v1/image_generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A serene mountain lake at sunset with golden reflections",
"reference_images": [
"https://example.com/ref.jpg"
],
"module": "std",
"generate_count": 2,
"image_quality": "2K",
"image_ratio": "16:9"
}
'import requests
url = "https://api.keevx.cn/v1/image_generate"
payload = {
"prompt": "A serene mountain lake at sunset with golden reflections",
"reference_images": ["https://example.com/ref.jpg"],
"module": "std",
"generate_count": 2,
"image_quality": "2K",
"image_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A serene mountain lake at sunset with golden reflections',
reference_images: ['https://example.com/ref.jpg'],
module: 'std',
generate_count: 2,
image_quality: '2K',
image_ratio: '16:9'
})
};
fetch('https://api.keevx.cn/v1/image_generate', 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.keevx.cn/v1/image_generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A serene mountain lake at sunset with golden reflections',
'reference_images' => [
'https://example.com/ref.jpg'
],
'module' => 'std',
'generate_count' => 2,
'image_quality' => '2K',
'image_ratio' => '16:9'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.keevx.cn/v1/image_generate"
payload := strings.NewReader("{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.keevx.cn/v1/image_generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keevx.cn/v1/image_generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A serene mountain lake at sunset with golden reflections\",\n \"reference_images\": [\n \"https://example.com/ref.jpg\"\n ],\n \"module\": \"std\",\n \"generate_count\": 2,\n \"image_quality\": \"2K\",\n \"image_ratio\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "ok",
"data": {
"task_ids": [
"i2is-a1b2c3d4e5f6",
"i2is-g7h8i9j0k1l2"
]
}
}回调通知
视频生成任务处理完成后,服务将向发起请求中提供的callback_url 发送一个 POST 请求。
结构
响应状态码。
0 表示回调发送成功。响应消息,通常为 “ok”。
任务类型。枚举值:
image_to_video。回调示例
{
"code": 0,
"msg": "ok",
"task_type": "image_generate",
"data": {
"task_id": "i2is-18e830d27ea041658e4accd576ea7008",
"status": "SUCCEEDED",
"image_url": "https://xiling-dh.bj.bcebos.com/f4231c3b-fa87-4930-90e3-29fcdcdd2759-i2is-f32d314204d64e75b9e13034ad3443d5-ai.png",
"error_message": ""
}
}
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
图片生成的文本提示词(必填)。
Maximum string length:
1000可选的参考图片 URL 列表。最多 5 张,每张不超过 20MB。支持格式:JPG、JPEG、PNG、BMP、WebP、GIF。超出部分会被静默截断为 5 张。
Maximum array length:
5生成模式。std = 标准模式(默认),pro = 专业模式。
可用选项:
std, pro 生成图片数量。每张图片会产生一个独立的任务 ID。
必填范围:
1 <= x <= 8输出图片质量/分辨率等级。
可用选项:
1K, 2K, 4K 输出图片宽高比。
可用选项:
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 ⌘I

