API

A server-to-server REST API. Create your key in the dashboard — it is shown once and never again.

Authentication

Send the key in the Authorization header. Do not use keys from a browser — these endpoints return no CORS headers.

Authorization: Bearer zt_live_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

POST /v1/clean

Cleans the text and returns it alongside a report of every character found.

curl -X POST https://api.zerotraceai.net/v1/clean \
  -H "Authorization: Bearer $ZEROTRACE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello world",
    "options": {
      "profile": "safe",
      "typography": false,
      "nfkc": false,
      "homoglyphs": true
    }
  }'
{
  "cleaned": "Hello world",
  "findings": [
    {
      "index": 5,
      "cp": 8203,
      "hex": "U+200B",
      "name": "ZERO WIDTH SPACE",
      "category": "zero_width",
      "action": "strip"
    }
  ],
  "summary": {
    "total": 1,
    "by_category": { "zero_width": 1 },
    "detectors": []
  },
  "usage": {
    "chars_in": 12,
    "credits_charged": 0,
    "quota_charged": 1,
    "quota_remaining": 24,
    "credits_remaining": 0
  },
  "engine_version": "0.1.0"
}

POST /v1/detect

Same body and same price, but returns only the findings — no cleaned text. Useful when you only need to know what is in a document.

GET /v1/me · GET /v1/usage

Returns your plan, limits, remaining quota and credit balance; /v1/usage returns paginated usage history.

Limits

PlanCharacters per requestRequests per minute
free30,00010
pro100,00060
scale500,000300

The request body is capped at 2 MB and text at 1,000,000 characters. Rate limits apply per account, not per key.

Errors

{ "error": { "code": "insufficient_credits", "message": "...", "details": { "needed": 3 } } }
400validation_error
401invalid_api_key
402insufficient_credits
403key_revoked
413text_too_large
429rate_limited
500internal_error

`code` is stable and machine-readable; `message` is English and may change. Localize from the code.

Privacy

The text you send is never stored or logged. Only counters are recorded: character count, finding count, category totals and what you were charged.