去除浮水印
清除圖片中的浮水印與疊加文字。
/v2/open/image/watermark_remove5 點數 / 次輸入
https://static.codia.ai/site/develop-sandbox/2026-10-04/2df3add4-3f1f-4a57-89fb-434045945669-headphones-watermarked.jpg
1024 × 1024 px · JPG · 167 KB頁面內直接執行功能即將推出。以下是 API 的真實請求與輸出——建立金鑰即可自行執行。
輸出
範例5 點數 / 次


自動偵測並移除浮水印、Logo 與印章,無需遮罩。僅限用於您擁有或有權編輯的圖片。
- 適用情境
- 清理您自有的封存素材
- 移除相機日期戳記
- 還原手上僅有浮水印版本的授權圖片
- 輸入
- 公開的圖片 URL 或上傳的圖片檔案。
- 輸出
- data.image_urls 包含清理後的圖片。若未偵測到浮水印,則回傳原圖。
- 執行方式
- 同步執行。
完整技術說明(英文)
Cost: 5 credits per successful call.
Image Watermark Remove supports two input modes:
- JSON URL mode: send
application/jsonwith the existing URL field. - Direct upload mode: send
multipart/form-datawith a local image file in theimagefield. The compatible field namefileis also accepted for the primary image. Codia checks credits before reading and uploading the file, so insufficient-credit requests return402without uploading anything.
Direct upload example:
curl 'https://openapi.codia.ai/v2/open/image/watermark_remove' \
-H 'Authorization: Bearer {codia_api_key}' \
-F 'image=@./image.png'Detect and remove visible watermarks from an image — text overlays, logos, repeated patterns, corner stamps. Auto-detection (no mask required). Synchronous.
⚠️ Use responsibly. Only call this endpoint on images you own or have explicit permission to edit. Removing watermarks from third-party content may violate copyright or terms of service.
What this API is for
Recovering pre-watermarked archive footage, removing automatic camera stamps from your own captures, cleaning up assets where you hold the rights but only have the watermarked export. Not for laundering stock photography or competitor content.
Request
| Field | Required | Notes |
|---|---|---|
image_url | yes | Public URL of the watermarked image. |
No model parameter — detection is automatic.
Response
Shared ImageUrlListSuccess — data.image_urls carries one URL of the cleaned image. If no watermark is detected, the original image (or a near-identity copy) is returned.
Billing & limits
- 5 credits per request from the unified Codia Open API balance.
- Synchronous.
Errors
Standard set.
Sync vs. async This synchronous endpoint returns the result inline — the simplest path. For production pipelines that need webhook delivery, automatic retry with idempotency, or explicit task cancellation, call
POST /v2/open/taskswithoperation=image_watermark_removeinstead. Inputs and credit cost are identical.
安裝與設定
將 API 金鑰存成執行環境中的環境變數。
export CODIA_API_KEY="your-api-key"驗證
以 Bearer 權杖傳送金鑰。金鑰可在儀表板中建立與撤銷。
Authorization: Bearer <your-api-key>送出請求
JSON 請求使用公開 URL。標示支援 multipart/form-data 的端點也可直接上傳檔案。
https://openapi.codia.ai·5 點數 / 次這些範例與 Sandbox 範例送出的是同一個請求,設定好 CODIA_API_KEY 即可直接執行。換成你自己的公開檔案 URL 即可。
curl -X POST 'https://openapi.codia.ai/v2/open/image/watermark_remove' \
-H "Authorization: Bearer $CODIA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"image_url": "https://static.codia.ai/site/develop-sandbox/2026-10-04/2df3add4-3f1f-4a57-89fb-434045945669-headphones-watermarked.jpg"
}'curl -X POST 'https://openapi.codia.ai/v2/open/image/watermark_remove' \
-H "Authorization: Bearer $CODIA_API_KEY" \
-F 'image=@./product.jpg'請求參數
Idempotency-Keystring · header選填選填,由使用者自訂的冪等鍵(最多 255 個字元)。設定後,成功(2xx)的回應會快取 7 天。以相同的鍵 + 相同的請求主體重試時,會回傳快取的回應(不另外扣除點數);以相同的鍵但不同的請求主體重試,則回傳 409。可讓 POST 請求在網路故障時安全重試。對於 multipart/form-data 上傳,請求會依表單欄位與檔案內容比對,因此即使用戶端產生新的 multipart boundary,重試的上傳仍會重播先前的結果。
image_urlstring必填待移除浮水印圖片的公開 URL
imagefile必填來源圖片檔案
filefile選填已淘汰相容用的來源圖片檔案欄位(已棄用:請改用 image)。
image_urlstring選填未上傳圖片時使用的來源圖片 URL
回應結構
200處理後的圖片 URL
codeintegermessagestringdataobjectdata.image_urlsstring[]產生或處理後的圖片 URL
{
"code": 0,
"message": "ok",
"data": {
"image_urls": [
"https://static.codia.ai/mark/image_8b24ee83-0d4a-48fe-aafe-fc79a22cf27d.png"
]
}
}錯誤代碼
錯誤使用相同的回應結構:code 與 HTTP 狀態碼一致,message 說明原因,data 為 null,部分錯誤還會附帶 details 物件。請依狀態碼判斷,不要依賴 message 文字。
{
"code": 401,
"message": "Unauthorized",
"data": null
}| 狀態碼 | 說明 |
|---|---|
| 400 | 請求主體格式錯誤或缺少必要參數 |
| 401 | API 金鑰遺失、無效或已撤銷 |
| 402 | 帳戶餘額不足或訂閱已過期 |
| 403 | 帳戶無權存取此端點 |
| 409 | Idempotency-Key 已被用於不同的請求主體。 |
| 429 | 已達速率限制。請等待 `Retry-After` 標頭中指定的秒數後再重試。 |
| 500 | 伺服器發生未預期的錯誤 |


