Submit an image generation task
curl --request POST \
--url https://api.keevx.com/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.com/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.com/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.com/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.com/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.com/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.com/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"
]
}
}Image generate
Create image generation task
Generate one or more AI images based on a text prompt and optional reference images. Returns a list of task IDs for polling.
POST
/
v1
/
image_generate
Submit an image generation task
curl --request POST \
--url https://api.keevx.com/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.com/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.com/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.com/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.com/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.com/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.com/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 Notification
After the video generation task is processed, the service will send a POST request to thecallback_url provided in the initiation request.
Structure
integer
Response status code.
0 indicates a successful callback transmission.string
Response message, usually “ok”.
string
The type of the task. Enum:
image_generate.object
The payload containing the generation results.
Show Show properties
Show Show properties
string
The unique identifier for the video generation task.
string
The execution status of the task. Enum:
SUCCEEDED, FAILED.string
The URL to access/download the generated video (valid when status is SUCCEEDED).
string
The URL of the generated video’s thumbnail/cover image.
string
Detailed error information if the task status is FAILED.
Callback Example
{
"code": 0,
"msg": "ok",
"task_type": "image_generate",
"data": {
"task_id": "i2is-18e830d27ea041658e4accd576ea7008",
"status": "SUCCEEDED",
"image_url": "https://storage.googleapis.com/xiling_us_central1_bucket/backend-saas-cdn/video-ai/image2image/10d88def-623d-4974-858a-b8c0ddfe2d1d-i2is-18e830d27ea041658e4accd576ea7008-process.png",
"error_message": ""
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Text prompt for image generation (required).
Maximum string length:
1000Optional list of reference image URLs. Max 5 images, each under 20MB. Supported formats: JPG, JPEG, PNG, BMP, WebP, GIF. Excess items are silently truncated to 5.
Maximum array length:
5Generation mode. std = Standard Model (default), pro = Pro Model.
Available options:
std, pro Number of images to generate. Each produces a separate task ID.
Required range:
1 <= x <= 8Output image quality / resolution tier.
Available options:
1K, 2K, 4K Output image aspect ratio.
Available options:
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 Response
Task submitted successfully, or a business-level error occurred.
Was this page helpful?

