Image edit
Edit one image at 1K, 2K, or 4K.
From 0.02 USDT
Cloud workflow
POST https://api.poton.ai/v1/tasks
Base URL https://api.poton.ai. Send JSON. Amounts are strings. Create a task with POST /v1/tasks. It returns 202.
Authentication
Authorization: Bearer YOUR_KEY
Send Idempotency-Key to make a retry return the original task instead of holding the price twice.
Authenticated requests are limited to 60 per minute for each API key.
Parameters
| Parameters | Type | Required |
|---|---|---|
| image Image |
image | Required |
| prompt Prompt |
string · 4000 | Required |
| negative_prompt Negative prompt |
string · 4000 | Required |
| resolution Resolution |
enum (1k, 2k, 4k) | Required |
| aspect Aspect |
enum (original, 9:16, 16:9, 1:1, 4:3, 3:4, 2:3) | Required |
| remove_subtitle Remove subtitles |
bool | Required |
curl
curl -X POST https://api.poton.ai/v1/tasks \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: example-1" \
-d '{
"workflow": "qwen-image",
"inputs": {
"image": {
"file_id": "upl_..."
},
"prompt": "your prompt",
"negative_prompt": "your negative prompt",
"resolution": "1k",
"aspect": "original",
"remove_subtitle": false
}
}'
Python
import requests
requests.post(
"https://api.poton.ai/v1/tasks",
headers={"Authorization": "Bearer YOUR_KEY"},
json={
"workflow": "qwen-image",
"inputs": {
"image": {
"file_id": "upl_..."
},
"prompt": "your prompt",
"negative_prompt": "your negative prompt",
"resolution": "1k",
"aspect": "original",
"remove_subtitle": False
}
},
)
JavaScript
await fetch("https://api.poton.ai/v1/tasks", {
method: "POST",
headers: {"Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json"},
body: JSON.stringify({
"workflow": "qwen-image",
"inputs": {
"image": {
"file_id": "upl_..."
},
"prompt": "your prompt",
"negative_prompt": "your negative prompt",
"resolution": "1k",
"aspect": "original",
"remove_subtitle": false
}
})
});
Return values
POST /v1/tasks returns 202. A new task has status queued, error null, and outputs []. Each field below belongs to that task object. Examples come from the completed GET /v1/tasks/{id}. Example values are samples.
| Parameters | Type | Example | Description |
|---|---|---|---|
id |
string | "task_0123456789abcdef01234567" |
Task id. It is already present in the 202 response. |
workflow |
string | "qwen-image" |
Slug of this API. |
status |
string | "succeeded" |
queued, running, succeeded, failed, or canceled. A new task is queued. |
price |
string | "0.120000" |
Price of this task, as a 6-decimal USDT string. |
error |
object | null |
null unless the task failed. A failure is an object with code and message. |
error.code |
string | "invalid_input" |
Stable error code. Present only when error is an object. The example is one possible code. |
error.message |
string | "Invalid input: prompt" |
Message in the caller's language. Present only when error is an object. The example is one possible message. |
outputs |
array | [{"url": "https://r2.poton.ai/results/task_0123456789abcdef01234567/ExampleImageToken00001.png", "type": "image", "bytes": 842131, "width": 1024, "height": 1024}] |
Result array. It is [] until the task succeeds, then one item. |
created_at |
string | "2026-11-09T08:00:00Z" |
Creation time, ISO 8601 in UTC. |
outputs[].url |
string | "https://r2.poton.ai/results/task_0123456789abcdef01234567/ExampleImageToken00001.png" |
Result file on r2.poton.ai. Not a supplier URL. |
outputs[].type |
string | "image" |
Result type for this API. The example is the success type. |
outputs[].bytes |
number | 842131 |
File size in bytes. |
outputs[].width |
number | 1024 |
Width in pixels. null when the size cannot be read. |
outputs[].height |
number | 1024 |
Height in pixels. null when the size cannot be read. |
Completed response
{
"id": "task_0123456789abcdef01234567",
"workflow": "qwen-image",
"status": "succeeded",
"price": "0.120000",
"error": null,
"outputs": [
{
"url": "https://r2.poton.ai/results/task_0123456789abcdef01234567/ExampleImageToken00001.png",
"type": "image",
"bytes": 842131,
"width": 1024,
"height": 1024
}
],
"created_at": "2026-11-09T08:00:00Z"
}
queued and running are unfinished. succeeded means the file is stored and the hold was captured. failed and canceled with no file release the hold.
queued · running · succeeded · failed · canceled
Errors
401 unauthorized · 402 insufficient_balance · 403 forbidden · 404 not_found · 409 idempotency_conflict · 413 file_too_large · 422 invalid_input · 422 content_rejected · 429 rate_limited · 500 upstream_unavailable · 500 result_copy_failed
The caller supplies the prompt and the negative prompt. Those two fields do not change the price. Aspect ratio does not change the price. Removing subtitles adds the amount in the price table. 4K is generated at 2K and then upscaled.