Jimeng Image Generation
curl --request POST \
--url https://zx1.deepwl.net/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"image": [
"<string>"
],
"ratio": "<string>",
"resolution": "<string>"
}
'import requests
url = "https://zx1.deepwl.net/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"image": ["<string>"],
"ratio": "<string>",
"resolution": "<string>"
}
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({
model: '<string>',
prompt: '<string>',
n: 123,
size: '<string>',
image: ['<string>'],
ratio: '<string>',
resolution: '<string>'
})
};
fetch('https://zx1.deepwl.net/v1/images/generations', 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://zx1.deepwl.net/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'n' => 123,
'size' => '<string>',
'image' => [
'<string>'
],
'ratio' => '<string>',
'resolution' => '<string>'
]),
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://zx1.deepwl.net/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\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://zx1.deepwl.net/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zx1.deepwl.net/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1735689600,
"data": [
{
"url": "https://example.com/generated-image.png",
"revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
}
]
}
Jimeng Image
Jimeng Image Generation
Use POST /v1/images/generations to call the Jimeng model for image generation.
POST
https://zx1.deepwl.net
/
v1
/
images
/
generations
Jimeng Image Generation
curl --request POST \
--url https://zx1.deepwl.net/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"image": [
"<string>"
],
"ratio": "<string>",
"resolution": "<string>"
}
'import requests
url = "https://zx1.deepwl.net/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"size": "<string>",
"image": ["<string>"],
"ratio": "<string>",
"resolution": "<string>"
}
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({
model: '<string>',
prompt: '<string>',
n: 123,
size: '<string>',
image: ['<string>'],
ratio: '<string>',
resolution: '<string>'
})
};
fetch('https://zx1.deepwl.net/v1/images/generations', 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://zx1.deepwl.net/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'n' => 123,
'size' => '<string>',
'image' => [
'<string>'
],
'ratio' => '<string>',
'resolution' => '<string>'
]),
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://zx1.deepwl.net/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\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://zx1.deepwl.net/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zx1.deepwl.net/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"size\": \"<string>\",\n \"image\": [\n \"<string>\"\n ],\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1735689600,
"data": [
{
"url": "https://example.com/generated-image.png",
"revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
}
]
}
Jimeng Image Generation
An image generation API in OpenAI-compatible format, supporting the image generation capabilities of the Jimeng model.- The route entry is
POST /v1/images/generations. - Currently submitted using
application/json. - Supports Jimeng models (
jimeng-4.0,jimeng-4.5). - Supports image-to-image generation by passing a reference image through the
imagefield.
Supported Models
jimeng-4.0: Jimeng 4.0 modeljimeng-4.5: Jimeng 4.5 model
Method and Path
POST /v1/images/generations
Request Example
curl -X POST https://zx1.deepwl.net/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"model": "jimeng-4.0",
"prompt": "A close-up depiction of a domestic cat in a relaxed state. The cat features vibrant orange fur, with striking white markings around its eyes that extend down to its soft, pink nose.",
"n": 1,
"size": "1024*1024"
}'
import requests
resp = requests.post(
"https://zx1.deepwl.net/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"model": "jimeng-4.0",
"prompt": "A close-up depiction of a domestic cat in a relaxed state. The cat features vibrant orange fur, with striking white markings around its eyes that extend down to its soft, pink nose.",
"n": 1,
"size": "1024*1024",
},
timeout=60,
)
print(resp.json())
const response = await fetch("https://zx1.deepwl.net/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
model: "jimeng-4.0",
prompt: "A close-up depiction of a domestic cat in a relaxed state. The cat features vibrant orange fur, with striking white markings around its eyes that extend down to its soft, pink nose.",
n: 1,
size: "1024*1024",
}),
});
console.log(await response.json());
Example with Reference Image
curl -X POST https://zx1.deepwl.net/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"model": "jimeng-4.0",
"prompt": "Generate a photorealistic image based on the reference image",
"n": 1,
"image": ["https://example.com/reference.png"],
"ratio": "16:9",
"resolution": "2k"
}'
import requests
resp = requests.post(
"https://zx1.deepwl.net/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"model": "jimeng-4.0",
"prompt": "Generate a photorealistic image based on the reference image",
"n": 1,
"image": ["https://example.com/reference.png"],
"ratio": "16:9",
"resolution": "2k",
},
timeout=60,
)
print(resp.json())
Response Example
{
"created": 1735689600,
"data": [
{
"url": "https://example.com/generated-image.png",
"revised_prompt": "A close-up depiction of a domestic cat in a relaxed state..."
}
]
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
string
required
Model name. Supports
jimeng-4.0 and jimeng-4.5.string
required
Prompt. The text description for image generation, supporting both Chinese and English.
integer
required
Number of images. The number of images to generate.
string
Image size. Resolution settings, such as
1024*1024.string[]
Reference image. An array of reference image URLs, used for image-to-image scenarios.
string
Image ratio. For example,
1:1, 16:9, 9:16, 4:3, 3:4, and so on.string
Resolution. Available values:
1k, 2k, 4k.Response
integer
Generation timestamp (Unix timestamp).
array
Array of generation results.
string
URL of the generated image.
string
Rewritten prompt (returned by some upstream services).
Related APIs
⌘I