Upper-body size
Estimate the upper-body size in one photo as small, medium, or large.
From 0.02 USDT
Runs on Poton
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 Photo |
image | 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": "upper-size",
"inputs": {
"image": {
"file_id": "upl_..."
}
}
}'
Python
import requests
requests.post(
"https://api.poton.ai/v1/tasks",
headers={"Authorization": "Bearer YOUR_KEY"},
json={
"workflow": "upper-size",
"inputs": {
"image": {
"file_id": "upl_..."
}
}
},
)
JavaScript
await fetch("https://api.poton.ai/v1/tasks", {
method: "POST",
headers: {"Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json"},
body: JSON.stringify({
"workflow": "upper-size",
"inputs": {
"image": {
"file_id": "upl_..."
}
}
})
});
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 | "upper-size" |
Slug of this API. |
status |
string | "succeeded" |
queued, running, succeeded, failed, or canceled. A new task is queued. |
price |
string | "0.100000" |
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/ExampleGradeToken000001.json", "type": "text", "bytes": 153, "grade": "medium", "labels": {"en": "Medium", "zh-Hans": "适中", "zh-Hant": "適中"}, "scores": {"small": 0.1023, "medium": 0.7841, "large": 0.1136}}] |
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/ExampleGradeToken000001.json" |
UTF-8 JSON file on r2.poton.ai. The file contains grade, labels, and scores. |
outputs[].type |
string | "text" |
Result type for this API. The example is the success type. |
outputs[].bytes |
number | 153 |
File size in bytes. |
outputs[].grade |
string | "medium" |
small, medium, or large. |
outputs[].labels |
object | {"en": "Medium", "zh-Hans": "适中", "zh-Hant": "適中"} |
Grade name in en, zh-Hans, and zh-Hant. |
outputs[].scores |
object | {"small": 0.1023, "medium": 0.7841, "large": 0.1136} |
Scores for small, medium, and large, rounded to 4 decimal places. |
Completed response
{
"id": "task_0123456789abcdef01234567",
"workflow": "upper-size",
"status": "succeeded",
"price": "0.100000",
"error": null,
"outputs": [
{
"url": "https://r2.poton.ai/results/task_0123456789abcdef01234567/ExampleGradeToken000001.json",
"type": "text",
"bytes": 153,
"grade": "medium",
"labels": {
"en": "Medium",
"zh-Hans": "适中",
"zh-Hant": "適中"
},
"scores": {
"small": 0.1023,
"medium": 0.7841,
"large": 0.1136
}
}
],
"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
Upload one photo, up to 30MB. Poton estimates the upper-body size of the most prominent person and returns Small, Medium, or Large. This is a visual estimate from the photo, not a tailor's measurement. A large estimate is kept. A small estimate is kept only when that area shows almost no skin; otherwise it is reported as medium. If no person is found, the central area of the photo is used. This runs on the Poton server and is not sent to a cloud workflow. Each success costs the price shown on this page. An unreadable image is not charged.