curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"size": "<string>",
"n": 123,
"analytics_context": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
image_url: '<string>',
size: '<string>',
n: 123,
analytics_context: {}
})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits"
payload = {
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"size": "<string>",
"n": 123,
"analytics_context": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"created": 1767225600,
"model": "gpt-image-1",
"size": "1024x1024",
"data": [
{
"url": "https://api.studio.prisme.ai/v2/files/file-abc.png?token=token-123"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}Edit an image
Edits an existing image from a prompt. Same model resolution,
governance and size resolution as POST /v1/images/generations
(the image-generation model permission applies).
The source image is passed as image_url, a URL the gateway can fetch
(for example a short-lived tokenised Prisme.ai file URL). The gateway
downloads it and sends it to the provider (multipart images/edits
for OpenAI / Azure gpt-image models, reference image for Vertex
Imagen). As for generation, results are always returned as URLs.
curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"size": "<string>",
"n": 123,
"analytics_context": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
image_url: '<string>',
size: '<string>',
n: 123,
analytics_context: {}
})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/images/edits"
payload = {
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"size": "<string>",
"n": 123,
"analytics_context": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"created": 1767225600,
"model": "gpt-image-1",
"size": "1024x1024",
"data": [
{
"url": "https://api.studio.prisme.ai/v2/files/file-abc.png?token=token-123"
}
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Body
Response
Edited images.
Was this page helpful?