Cập nhật: 08/09/2026
Gửi một ảnh, nhận lại ảnh đã xoá watermark. Một request một ảnh, 1 credit mỗi ảnh xử lý được.
Xác thực
Tạo khoá ở Tài khoản → Khoá API. Gửi kèm mỗi request:
Authorization: Bearer rmv_live_…
Hoặc X-Api-Key: rmv_live_…
POST /api/v1/remove
multipart/form-data
| Trường | Bắt buộc | Giá trị |
|---|---|---|
image | có | Tệp ảnh: JPEG, PNG, WebP |
curl -X POST https://hoanlab.com/api/v1/remove \
-H "Authorization: Bearer $REMOVER_API_KEY" \
-F "[email protected]" \
-o anh-da-xoa.jpg
Phản hồi
Ba trường hợp, phân biệt bằng Content-Type:
| HTTP | Content-Type | Thân | Credit |
|---|---|---|---|
| 200 | image/* | Ảnh đã xoá watermark | 1 |
| 200 | application/json | Không tìm thấy watermark | 0 |
| 4xx, 5xx | application/json | Lỗi | 0 |
HTTP/1.1 200 OK
Content-Type: image/jpeg
X-Credits-Charged: 1
X-Request-Id: req_8099a383f42e4e00a0f2
<byte ảnh>
HTTP/1.1 200 OK
Content-Type: application/json
X-Credits-Charged: 0
{
"action": "no_mark",
"message": "Không tìm thấy watermark nào trong ảnh này.",
"charged": 0,
"request_id": "req_ea785a107e88470d92cd"
}
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"error": "no_credits",
"message": "Hết credit. Nạp thêm tại https://hoanlab.com/remover/buy",
"request_id": "req_4532a6cab69f4dfe823b"
}
GET /api/v1/account
curl https://hoanlab.com/api/v1/account \
-H "Authorization: Bearer $REMOVER_API_KEY"
{"balance": 147}
Giới hạn
| Kích thước tệp | 25 MB |
| Điểm ảnh — JPEG, WebP | 30 MP |
| Điểm ảnh — PNG | 12 MP |
| Ảnh mỗi request | 1 |
Mã lỗi
| HTTP | error | Nghĩa | Thử lại |
|---|---|---|---|
| 400 | bad_request | Thiếu image, hoặc tệp không đọc được như ảnh | không |
| 401 | key_missing | Không có header khoá | không |
| 401 | key_malformed | Khoá sai định dạng | không |
| 401 | key_conflict | Hai header mang hai khoá khác nhau | không |
| 401 | key_invalid | Khoá không hợp lệ | không |
| 401 | key_revoked | Khoá đã thu hồi | không |
| 401 | key_expired | Khoá đã hết hạn | không |
| 402 | no_credits | Hết credit | sau khi nạp |
| 403 | account_banned | Tài khoản bị khoá | không |
| 405 | method_not_allowed | Chỉ nhận POST | không |
| 413 | file_too_large | Tệp quá 25 MB | không |
| 413 | image_too_large | Ảnh vượt trần điểm ảnh | không |
| 429 | rate_limited | Quá nhiều ảnh đang xử lý | có |
| 500 | internal | Lỗi phía chúng tôi | một lần |
| 502 | upstream | Máy chủ xử lý không phản hồi | có |
| 503 | busy | Máy chủ đang bận | có |
Mọi phản hồi đều có X-Request-Id. Gửi kèm mã đó khi báo lỗi.
Ví dụ
import os, requests
r = requests.post(
"https://hoanlab.com/api/v1/remove",
headers={"Authorization": f"Bearer {os.environ['REMOVER_API_KEY']}"},
files={"image": open("anh.jpg", "rb")},
timeout=120,
)
if r.headers.get("Content-Type", "").startswith("image/"):
open("anh-da-xoa.jpg", "wb").write(r.content)
else:
d = r.json()
print(d.get("action") or d.get("error"), d["message"], d["request_id"])
import { readFile, writeFile } from 'node:fs/promises'
const form = new FormData()
form.append('image', new Blob([await readFile('anh.jpg')]), 'anh.jpg')
const r = await fetch('https://hoanlab.com/api/v1/remove', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.REMOVER_API_KEY}` },
body: form,
})
if (r.headers.get('content-type')?.startsWith('image/')) {
await writeFile('anh-da-xoa.jpg', Buffer.from(await r.arrayBuffer()))
} else {
const d = await r.json()
console.log(d.action ?? d.error, d.message, d.request_id)
}
<?php
$ch = curl_init('https://hoanlab.com/api/v1/remove');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('REMOVER_API_KEY')],
CURLOPT_POSTFIELDS => ['image' => new CURLFile('anh.jpg')],
]);
$body = curl_exec($ch);
$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
if (str_starts_with($type, 'image/')) {
file_put_contents('anh-da-xoa.jpg', $body);
} else {
$d = json_decode($body, true);
echo ($d['action'] ?? $d['error']) . ' ' . $d['message'] . ' ' . $d['request_id'] . "\n";
}
← Về công cụ · Điều khoản · Quyền riêng tư · [email protected]