Endpoint
Request Parameters
Examples
Basic edit
Response
Same format as/ai/images/generate:
Errors
The
input_image URL must be publicly downloadable. URLs that require authentication or block automated access will fail.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Edit images using text prompts
POST /api/ai/images/edit
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | yes | — | Image editing model (e.g. qwen-image-edit, nano-banana-2-edit, xai-grok-imagine-image-edit) |
prompt | string | yes | — | Description of the edit to apply. |
input_image | string (URL) | yes | — | URL of the image to edit. Must be publicly accessible. |
response_format | string | no | "url" | "url" returns a hosted URL. "b64_json" returns base64-encoded image bytes inline. |
target_namespace | string | no | current user | Namespace to save results and bill to. Can be an organization name. |
import requests
response = requests.post(
"https://hub.oxen.ai/api/ai/images/edit",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "qwen-image-edit",
"prompt": "Make the background blue",
"input_image": "https://example.com/my-photo.jpg",
},
)
data = response.json()
print("Image URL:", data["images"][0]["url"])
curl -X POST https://hub.oxen.ai/api/ai/images/edit \
-H "Authorization: Bearer $OXEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-edit",
"prompt": "Make the background blue",
"input_image": "https://example.com/my-photo.jpg"
}'
/ai/images/generate:
{
"model": "qwen-image-edit",
"created": 1775090400,
"images": [
{
"url": "https://hub.oxen.ai/api/repos/.../files/.../image.png?..."
}
]
}
| Condition | Error |
|---|---|
| Image URL not accessible | "... 403 Client Error: Forbidden for url: ..." |
| Model not found | "Model not found: <name>" |
input_image URL must be publicly downloadable. URLs that require authentication or block automated access will fail.