Loading...
Loading...
Compare original and translation side by side
export YOUTHUMB_API_KEY="your-api-key-here"x-api-key: $YOUTHUMB_API_KEYexport YOUTHUMB_API_KEY="your-api-key-here"x-api-key: $YOUTHUMB_API_KEYhttps://www.youthumb.aihttps://www.youthumb.ai| Method | Endpoint | Description |
|---|---|---|
| Assets | ||
| POST | | Upload an image |
| GET | | List all assets |
| GET | | Get asset details |
| DELETE | | Delete an asset |
| Thumbnails | ||
| POST | | Create a project |
| POST | | Start generation (costs credits) |
| GET | | Simple status check |
| GET | | Status with image URLs |
| Persons | ||
| GET | | List all persons |
| POST | | Create a person |
| GET | | Get person details |
| POST | | Add face images to a person |
| Other | ||
| GET | | List available templates |
| GET | | List available presets |
| 方法 | 端点 | 描述 |
|---|---|---|
| 资源管理 | ||
| POST | | 上传图片 |
| GET | | 列出所有资源 |
| GET | | 获取资源详情 |
| DELETE | | 删除资源 |
| 缩略图管理 | ||
| POST | | 创建项目 |
| POST | | 启动生成任务(消耗积分) |
| GET | | 简易状态查询 |
| GET | | 包含图片URL的详细状态查询 |
| 人物管理 | ||
| GET | | 列出所有人物 |
| POST | | 创建人物 |
| GET | | 获取人物详情 |
| POST | | 为人物添加人脸图片 |
| 其他 | ||
| GET | | 列出可用模板 |
| GET | | 列出可用预设 |
undefinedundefined
Response:
```json
{"success": true, "data": {"id": "uuid-of-person", "name": "John Creator"}}undefined
返回结果:
```json
{"success": true, "data": {"id": "uuid-of-person", "name": "John Creator"}}undefined
Upload 3-5 images with different angles and lighting for best results.
为了获得最佳效果,请上传3-5张不同角度、不同光照条件的图片。undefinedundefined
Response:
```json
{"success": true, "data": {"id": "uuid", "url": "https://...supabase.co/..."}}"type": "bucket"file /path/to/image.png
返回结果:
```json
{"success": true, "data": {"id": "uuid", "url": "https://...supabase.co/..."}}"type": "bucket"file /path/to/image.pngcurl -s -X POST "https://www.youthumb.ai/api/thumbnails" \
-H "x-api-key: $YOUTHUMB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Person on the left with a confident smirk. @image1 (React logo) floating on the right with blue glow. Clean dark background with subtle teal lighting. No text.",
"presetKey": "free",
"projectName": "React Tutorial Thumb",
"personId": "your-person-uuid",
"contentImages": [
{"url": "https://...your-uploaded-asset-url..."}
],
"advancedOptions": {
"variations": 1,
"faceExpression": "confident",
"textPosition": "none"
}
}'{"success": true, "data": {"id": "project-uuid", "status": "draft"}}curl -s -X POST "https://www.youthumb.ai/api/thumbnails" \
-H "x-api-key: $YOUTHUMB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Person on the left with a confident smirk. @image1 (React logo) floating on the right with blue glow. Clean dark background with subtle teal lighting. No text.",
"presetKey": "free",
"projectName": "React Tutorial Thumb",
"personId": "your-person-uuid",
"contentImages": [
{"url": "https://...your-uploaded-asset-url..."}
],
"advancedOptions": {
"variations": 1,
"faceExpression": "confident",
"textPosition": "none"
}
}'{"success": true, "data": {"id": "project-uuid", "status": "draft"}}@image1@image2@image3contentImages@image1 → contentImages[0]
@image2 → contentImages[1]
@image3 → contentImages[2]@imageN (description)Subject on the left, confident expression. @image1 (Claude Code logo) prominently displayed center-right with orange glow. @image2 (code screenshot) in the background with glass overlay. Dark cinematic atmosphere.
@image1@image2@image3contentImages@image1 → contentImages[0]
@image2 → contentImages[1]
@image3 → contentImages[2]@imageN (描述)主体在左侧,表情自信。@image1(Claude Code logo)放在中右侧位置,带有橙色发光效果。@image2(代码截图)放在背景,添加玻璃态覆盖层。整体为深色电影质感氛围。
{"url": "https://..."} // By direct URL (preferred)
{"userImageId": "asset-uuid"} // By uploaded asset ID{"url": "https://..."} // 直接使用URL(推荐)
{"userImageId": "asset-uuid"} // 使用已上传资源的IDundefinedundefined
Check that `contentImages` contains the correct URLs (not empty objects `{}`).
```bash
确认`contentImages`中包含正确的URL(不要是空对象`{}`)。
```bash
The `start` endpoint optionally accepts `prompt` and `advancedOptions` to override the project config:
```bash
curl -s -X POST "https://www.youthumb.ai/api/thumbnails/$PROJECT_ID/start" \
-H "x-api-key: $YOUTHUMB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Alternative prompt for this generation run"}'
`start`端点可选传入`prompt`和`advancedOptions`参数来覆盖项目的原有配置:
```bash
curl -s -X POST "https://www.youthumb.ai/api/thumbnails/$PROJECT_ID/start" \
-H "x-api-key: $YOUTHUMB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Alternative prompt for this generation run"}'curl -s "https://www.youthumb.ai/api/thumbnails/$PROJECT_ID/detailed-status" \
-H "x-api-key: $YOUTHUMB_API_KEY"status: "completed"jobs[].images.results[]curl -s "https://www.youthumb.ai/api/thumbnails/$PROJECT_ID/detailed-status" \
-H "x-api-key: $YOUTHUMB_API_KEY"status: "completed"jobs[].images.results[]| Field | Required | Rules |
|---|---|---|
| ✅ Yes | 3-2000 characters |
| ✅ Yes | Use |
| No | UUID — do not combine with |
| No | Max 100 chars — do not combine with |
| No | Max 100 chars |
| No | Max 5 items, each |
| No | Max 200 chars |
| No | UUID |
| No | Valid URL |
| No | Valid URL |
| 字段 | 必填 | 规则 |
|---|---|---|
| ✅ 是 | 3-2000个字符 |
| ✅ 是 | 请使用 |
| 否 | UUID — 不要和 |
| 否 | 最多100个字符 — 不要和 |
| 否 | 最多100个字符 |
| 否 | 最多5项,每项格式为 |
| 否 | 最多200个字符 |
| 否 | UUID |
| 否 | 合法URL |
| 否 | 合法URL |
| Field | Values | Default |
|---|---|---|
| 1, 2, 3, or 4 | 1 |
| neutral, happy, surprised, excited, serious, confident, keep-original | confident |
| top, center, bottom, none, keep-original | none |
| Max 500 chars | — |
| casual, professional, sporty, elegant, streetwear, keep-original | keep-original |
| subtle, normal, enhanced, keep-original | normal |
| 0-100 | 0 |
| 字段 | 可选值 | 默认值 |
|---|---|---|
| 1, 2, 3, 4 | 1 |
| neutral(中性), happy(开心), surprised(惊讶), excited(兴奋), serious(严肃), confident(自信), keep-original(保持原图) | confident(自信) |
| top(顶部), center(居中), bottom(底部), none(无), keep-original(保持原图) | none(无) |
| 最多500个字符 | — |
| casual(休闲), professional(职业), sporty(运动), elegant(优雅), streetwear(街头风), keep-original(保持原图) | keep-original(保持原图) |
| subtle(轻度), normal(普通), enhanced(增强), keep-original(保持原图) | normal(普通) |
| 0-100 | 0 |
401 Unauthorized401 Unauthorized| Code | Meaning | Action |
|---|---|---|
| 400 | Bad request | Check required fields and validation rules |
| 401 | Invalid/missing API key | Verify your key — or wait (could be rate limit) |
| 402 | Insufficient credits | Top up credits at youthumb.ai |
| 403 | Access denied | Check account permissions |
| 404 | Resource not found | Verify project/person/asset ID |
| 429 | Rate limited | Wait 30-45 seconds and retry |
| 500 | Server error | Retry after a delay |
| 错误码 | 含义 | 处理方式 |
|---|---|---|
| 400 | 请求参数错误 | 检查必填字段和校验规则 |
| 401 | API密钥无效/缺失 | 校验你的密钥 — 或者等待重试(可能是速率限制) |
| 402 | 积分不足 | 前往youthumb.ai充值积分 |
| 403 | 访问被拒绝 | 检查账户权限 |
| 404 | 资源不存在 | 校验项目/人物/资源ID |
| 429 | 触发速率限制 | 等待30-45秒后重试 |
| 500 | 服务器错误 | 等待一段时间后重试 |
detailed-statuspresetKey: "free"@image1 (description)detailed-statuspresetKey: "free"@image1 (描述)