curl --request POST \
--url 'https://api.elkapi.com/v1/images/edits' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/images/edits"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/edits";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"url": "https://example.com/image.png",
"b64_json": "b64_json",
"revised_prompt": "revised_prompt"
}
]
}
Qwen OpenAI Format
Edit Image
- Bailian qwen-image series image editing
POST
/
v1
/
images
/
edits
curl --request POST \
--url 'https://api.elkapi.com/v1/images/edits' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/images/edits"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/edits";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"url": "https://example.com/image.png",
"b64_json": "b64_json",
"revised_prompt": "revised_prompt"
}
]
}
curl --request POST \
--url 'https://api.elkapi.com/v1/images/edits' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/images/edits"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/edits";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-image-1.5",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"url": "https://example.com/image.png",
"b64_json": "b64_json",
"revised_prompt": "revised_prompt"
}
]
}
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY
Body
string
default:"gpt-image-1.5"
required
Example:
gpt-image-1.5Response
integer
⌘I