Skip to content

Task: Remove Watermark - Automatic

Short description: Use the automatic watermark removal API to remove watermarks from images and return the processed result file.


Overview

  • Method: POST
  • Path: /task/pic/watermark_auto
  • Content-Type: multipart/form-data

Authentication

  • Header: Authorization: Bearer <token>

Request Example

Form Parameters

ParameterTypeRequiredDescription
filefileNoSource image file (binary), mutually exclusive with url
urlstringNoSource image URL, mutually exclusive with file
syncintegerNoWhether to wait for the result: 0=async (default), 1=sync
callback_urlstringNoCallback URL for notifications

curl Example

bash
curl -X POST "https://api.gpt.ge/task/pic/watermark_auto" \
  -H "Authorization: Bearer sk-xxxx" \
  -F "url=https://example.com/image-with-watermark.png" \
  -F "sync=1"

JavaScript (fetch) Example

javascript
const formData = new FormData();
formData.append('url', 'https://example.com/image-with-watermark.png');
formData.append('sync', '1');

fetch('https://api.gpt.ge/task/pic/watermark_auto', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk-xxxx'
  },
  body: formData
}).then(r => r.json()).then(console.log);

Python (requests) Example

python
import requests

url = 'https://api.gpt.ge/task/pic/watermark_auto'
headers = {
    'Authorization': 'Bearer sk-xxxx'
}

files = {
    'url': (None, 'https://example.com/image-with-watermark.png')
}
data = {
    'sync': '1'
}

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())

Response Example (200)

json
{
  "status": 200,
  "data": {
    "completed_at": 1746948962,
    "created_at": 1746948961,
    "file": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/visual_external_watermark_remove/2db16fc5-4fbb-43b7-b6bb-ab0c3340a5e6.jpg",
    "processed_at": 1746948961,
    "progress": 100,
    "state": 1,
    "state_detail": "Complete",
    "task_id": "2db16fc5-4fbb-43b7-b6bb-ab0c3340a5e6"
  }
}

Note: This endpoint uses multipart/form-data to upload the image. Submit either file or url, not both.