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

POST /v1/text/clean

Submit 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

ParameterTypeRequiredDescription
textstringYesThe input text to process. Maximum 100,000 characters. Supports plain text, markdown, and HTML.
preserve_formattingbooleanNoWhen true, maintains original whitespace, line breaks, and markdown formatting. Default: true.
modelstringNoRemoval strength. Options: "standard" (balanced accuracy), "aggressive" (maximum removal), "conservative" (minimal changes). Default: "standard".
output_formatstringNoResponse format for clean_text. Options: "text", "markdown", "html". Default: matches input format.
include_diffbooleanNoWhen true, includes a token-level diff showing each substitution made. Default: false.
webhook_urlstringNoURL to POST results to when processing completes. Useful for large documents processed asynchronously.

Request Example

python
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
)
javascript
class="syn-keyword">const result = await client.text.remove({
  text: &class=class="syn-string">"syn-comment">#39;Claude tends to select specific synonym patterns...',
  preserveFormatting: true,
  model: &class=class="syn-string">"syn-comment">#39;standard',
  includeDiff: true
});
bash
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

json
{
  "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

ParameterTypeRequiredDescription
clean_textstringThe processed text with watermark patterns removed.
watermark_detectedbooleanWhether the input text was identified as containing a Claude watermark.
confidencefloatProbability (0.0 to 1.0) that the text contained a watermark. Values above 0.7 indicate high confidence.
tokens_changedintegerNumber of tokens substituted during the removal process.
processing_msintegerServer-side processing time in milliseconds.
diffarrayToken-level diff showing each substitution. Only included when include_diff is true.
request_idstringUnique identifier for this request. Include in support tickets for debugging.

Error Codes

StatusCodeDescription
400invalid_textInput text is empty or exceeds the 100,000 character limit.
400invalid_modelUnrecognized model parameter. Must be "standard", "aggressive", or "conservative".
401unauthorizedMissing or invalid API key. Check your Authorization header.
429rate_limit_exceededToo many requests. Check the Retry-After header and back off.
500processing_errorInternal 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.

bash
curl -G https:"syn-comment">//api.claudewatermark.org/v1/text/scan \
  --data-urlencode "syn-string">"text=Your text to analyze..."