Jimeng Image Editing
curl --request POST \
--url https://www.token-nova.com/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"ratio": "<string>",
"quality": "<string>",
"response_format": "<string>",
"resolution": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/images/edits"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"ratio": "<string>",
"quality": "<string>",
"response_format": "<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,
ratio: '<string>',
quality: '<string>',
response_format: '<string>',
resolution: '<string>'
})
};
fetch('https://www.token-nova.com/v1/images/edits', 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://www.token-nova.com/v1/images/edits",
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,
'ratio' => '<string>',
'quality' => '<string>',
'response_format' => '<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://www.token-nova.com/v1/images/edits"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<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://www.token-nova.com/v1/images/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<string>\",\n \"resolution\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/images/edits")
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 \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<string>\",\n \"resolution\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1735689600,
"data": [
{
"url": "https://example.com/edited-image.png",
"revised_prompt": "Generate a photorealistic image based on the reference image"
}
]
}
Jimeng Image
Jimeng Image Editing
Use POST /v1/images/edits to generate a new image by editing based on a reference image.
POST
https://www.token-nova.com
/
v1
/
images
/
edits
Jimeng Image Editing
curl --request POST \
--url https://www.token-nova.com/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"n": 123,
"ratio": "<string>",
"quality": "<string>",
"response_format": "<string>",
"resolution": "<string>"
}
'import requests
url = "https://www.token-nova.com/v1/images/edits"
payload = {
"model": "<string>",
"prompt": "<string>",
"n": 123,
"ratio": "<string>",
"quality": "<string>",
"response_format": "<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,
ratio: '<string>',
quality: '<string>',
response_format: '<string>',
resolution: '<string>'
})
};
fetch('https://www.token-nova.com/v1/images/edits', 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://www.token-nova.com/v1/images/edits",
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,
'ratio' => '<string>',
'quality' => '<string>',
'response_format' => '<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://www.token-nova.com/v1/images/edits"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<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://www.token-nova.com/v1/images/edits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<string>\",\n \"resolution\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.token-nova.com/v1/images/edits")
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 \"ratio\": \"<string>\",\n \"quality\": \"<string>\",\n \"response_format\": \"<string>\",\n \"resolution\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1735689600,
"data": [
{
"url": "https://example.com/edited-image.png",
"revised_prompt": "Generate a photorealistic image based on the reference image"
}
]
}
Jimeng Image Editing
An OpenAI-compatible image editing interface, submitted usingmultipart/form-data, supports generating new images based on a reference image.
- The route entry is
POST /v1/images/edits. - Currently submitted using
multipart/form-data. - A reference image file must be provided for editing.
- Supports Jimeng model image editing capabilities.
Supported Models
jimeng-4.0: Jimeng 4.0 modeljimeng-4.5: Jimeng 4.5 model
Method and Path
POST /v1/images/edits
Request Example
curl -X POST https://www.token-nova.com/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=jimeng-4.0" \
-F "prompt=Generate a photorealistic image based on the reference image" \
-F "image=@/path/to/image.png" \
-F "n=1" \
-F "ratio=16:9"
import requests
with open("image.png", "rb") as f:
resp = requests.post(
"https://www.token-nova.com/v1/images/edits",
headers={"Authorization": "Bearer YOUR_API_KEY"},
data={
"model": "jimeng-4.0",
"prompt": "Generate a photorealistic image based on the reference image",
"n": 1,
"ratio": "16:9",
},
files={"image": f},
timeout=60,
)
print(resp.json())
Response Example
{
"created": 1735689600,
"data": [
{
"url": "https://example.com/edited-image.png",
"revised_prompt": "Generate a photorealistic image based on the reference image"
}
]
}
Authentication
Authorization: Bearer YOUR_API_KEY
Body
The image to edit. Upload a single image file for editing. It must be a supported image file, supporting png, webp, and jpg formats, with each image no larger than 25MB.
Quality of the generated image.
auto (default) will automatically select the best quality for the given model. gpt-image-l supports high, medium, and low; dall-e-3 supports hd and standard; dall-e-2 supports only standard.