{"openapi":"3.1.0","info":{"title":"RemoveHandwriting API","description":"AI-powered handwriting removal service. Upload an image with handwritten content and receive a cleaned version with handwriting removed. Supports single images, batch processing, and PDF documents.","version":"1.0.0","contact":{"email":"service@removehandwriting.com"}},"servers":[{"url":"https://removehandwriting.com","description":"Production"}],"paths":{"/api/process-image":{"post":{"operationId":"processImage","summary":"Remove handwriting from image","description":"Upload an image containing handwritten content. Returns the processed image as base64 in the response. Logged-in users can submit directly. Web guest uploads must include cfTurnstileToken, except the PDF guest flow. App anonymous uploads must use an established anonymous account session identified by X-User-Type/X-Device-Id plus the matching anonymous userId. Rate limited: 5/min, 30/hour. Max file size: 5MB.","parameters":[{"name":"preserveColor","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"When true, uses Baidu API to preserve original colors"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary","description":"Image file (JPEG, PNG, etc.). Max 5MB."},"userId":{"type":"string","description":"User ID for logged-in requests or the AnonymousUser.id of an established app-anonymous session. Web guest uploads may omit it."},"deviceId":{"type":"string","description":"Web/PDF guest device ID. App anonymous requests use X-Device-Id instead."},"cfTurnstileToken":{"type":"string","description":"Cloudflare Turnstile token required for Web guest uploads, except the PDF guest flow."},"preserveColor":{"type":"string","enum":["true","false"],"description":"Preserve original colors (uses Baidu API)"},"isBulkProcessing":{"type":"string","enum":["true","false"],"description":"Whether this is a bulk processing request"},"isPdfProcessing":{"type":"string","enum":["true","false"],"description":"Whether this is a PDF processing request"},"pageSlug":{"type":"string","description":"Page identifier for analytics"}}}}}},"responses":{"200":{"description":"Success - returns processed image as base64","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","example":0},"data":{"type":"object","properties":{"data":{"type":"object","properties":{"mediaId":{"type":"string","description":"Base64-encoded processed image"}}}}},"isTrial":{"type":"boolean","description":"True if guest/trial user"}}}}}},"400":{"description":"Bad request - missing file, invalid type, or verification failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"402":{"description":"Payment required - insufficient credits","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"INSUFFICIENT_CREDITS"},"message":{"type":"string"},"redirectUrl":{"type":"string","example":"/pricing"}}}}}},"408":{"description":"Request timeout","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"RATE_LIMIT_EXCEEDED"},"limitType":{"type":"string"},"retryAfter":{"type":"integer"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}}}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}