Text Watermark Removal — API Reference
Remove distributional watermarks embedded in Claude-generated text. The text removal endpoint analyzes token probability distributions, identifies watermark-induced biases, and substitutes affected tokens with semantically equivalent alternatives that restore natural language distribution patterns.
Endpoint
/v1/text/cleanSubmit text content for watermark detection and removal. The endpoint accepts plain text, markdown, or HTML content up to 100,000 characters per request. For longer documents, use the batch endpoint or split your content into chunks. The API processes text in a single pass using a transformer-based model that identifies watermarked token sequences and replaces them with natural alternatives while preserving the original meaning, tone, and structure of the content.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The input text to process. Maximum 100,000 characters. Supports plain text, markdown, and HTML. |
preserve_formatting | boolean | No | When true, maintains original whitespace, line breaks, and markdown formatting. Default: true. |
model | string | No | Removal strength. Options: "standard" (balanced accuracy), "aggressive" (maximum removal), "conservative" (minimal changes). Default: "standard". |
output_format | string | No | Response format for clean_text. Options: "text", "markdown", "html". Default: matches input format. |
include_diff | boolean | No | When true, includes a token-level diff showing each substitution made. Default: false. |
webhook_url | string | No | URL to POST results to when processing completes. Useful for large documents processed asynchronously. |
Request Example
result = client.text.remove(
text=class=class="syn-string">"syn-string">"Claude tends to select specific synonym patterns...",
preserve_formatting=True,
model=class=class="syn-string">"syn-string">"standard",
include_diff=True
)
class="syn-keyword">const result = await client.text.remove({
text: &class=class="syn-string">"syn-comment">#39;Claude tends to select specific synonym patterns...39;,
preserveFormatting: true,
model: &class=class="syn-string">"syn-comment">#39;standard39;,
includeDiff: true
});
curl -X POST https:"syn-comment">//api.claudewatermark.org/v1/text/clean \
-H "syn-string">"Content-Type: application/json" \
-d &"syn-comment">#39;{
"syn-string">"text": "syn-string">"Claude tends to select specific synonym patterns...",
"syn-string">"preserve_formatting": true,
"syn-string">"model": "syn-string">"standard",
"syn-string">"include_diff": true
}&"syn-comment">#39;
Response
{
"syn-string">"clean_text": "syn-string">"AI systems tend to choose particular word patterns...",
"syn-string">"watermark_detected": true,
"syn-string">"confidence": 0.92,
"syn-string">"tokens_changed": 18,
"syn-string">"original_length": 2341,
"syn-string">"clean_length": 2338,
"syn-string">"processing_ms": 63,
"syn-string">"model": "syn-string">"standard",
"syn-string">"diff": [
{ "syn-string">"position": 12, "syn-string">"original": "syn-string">"select", "syn-string">"replacement": "syn-string">"choose", "syn-string">"reason": "syn-string">"biased_probability" },
{ "syn-string">"position": 15, "syn-string">"original": "syn-string">"specific", "syn-string">"replacement": "syn-string">"particular", "syn-string">"reason": "syn-string">"biased_probability" },
{ "syn-string">"position": 19, "syn-string">"original": "syn-string">"synonym", "syn-string">"replacement": "syn-string">"word", "syn-string">"reason": "syn-string">"distribution_anomaly" }
],
"syn-string">"api_version": "syn-string">"v1",
"syn-string">"request_id": "syn-string">"req_abc123"
}
Response Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
clean_text | string | — | The processed text with watermark patterns removed. |
watermark_detected | boolean | — | Whether the input text was identified as containing a Claude watermark. |
confidence | float | — | Probability (0.0 to 1.0) that the text contained a watermark. Values above 0.7 indicate high confidence. |
tokens_changed | integer | — | Number of tokens substituted during the removal process. |
processing_ms | integer | — | Server-side processing time in milliseconds. |
diff | array | — | Token-level diff showing each substitution. Only included when include_diff is true. |
request_id | string | — | Unique identifier for this request. Include in support tickets for debugging. |
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | invalid_text | Input text is empty or exceeds the 100,000 character limit. |
| 400 | invalid_model | Unrecognized model parameter. Must be "standard", "aggressive", or "conservative". |
| 401 | unauthorized | Missing or invalid API key. Check your Authorization header. |
| 429 | rate_limit_exceeded | Too many requests. Check the Retry-After header and back off. |
| 500 | processing_error | Internal error during watermark removal. Retry the request. |
Detection-Only Mode
If you only need to detect watermarks without removing them, use the GET /v1/text/scan endpoint instead. This is useful for classification pipelines, content moderation systems, or audit workflows where you need to flag AI-generated content without modifying it. Detection-only requests are billed at half the rate of removal requests and typically complete in under 30ms since no substitution processing is required.
curl -G https:"syn-comment">//api.claudewatermark.org/v1/text/scan \
--data-urlencode "syn-string">"text=Your text to analyze..."