text

Redact secrets from arbitrary text.

Redact secrets from arbitrary text. Deterministic, keyless, pure compute — no data is stored. Pass text (up to 256 KB); each detected credential is replaced in-place with a [redacted:<kind>] marker (surrounding text is preserved so the result stays greppable), and you get per-kind hit counts. Detects: PEM private-key blocks, JWTs, AWS access-key ids (AKIA/ASIA), GitHub tokens (ghp_/gho_/ghu_/ghs_/ghr_), Stripe keys (sk_/pk_/rk_ live|test), OpenAI keys (sk-…), npm tokens (npm_…), Slack tokens (xox[baprs]-…), Google API keys (AIza…), HTTP Bearer tokens, scheme://user:password@host URL credentials, and generic api_key/secret/token/password assignments. Idempotent. Useful before logging, storing (see store.doc-put redact=true), or sharing agent/tool output.

post/api/text/redact

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/text/redact
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Request body

textstring required

The text to scrub. Up to 256 KB.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.