Get started
Quickstart
Get a key, redact a sentence, restore it. About 3 minutes, no card.
1. Get a free API key
Click Get an API key (top right), or use the terminal:
curl -s https://api.obscate.com/v1/signup \
-H 'content-type: application/json' \
-d '{"email":"you@company.com"}'
{"account_id": "…", "api_key": "ob_7d3nmlvc_…", "plan": "free",
"note": "Store this key now — it is shown only once. Verify your email to unlock paid plans."}
The key is shown once; we store only an HMAC of it. Free plan: 1,000 requests a month, 60 a minute. Then:
export OBSCATE_API_KEY=ob_...
2. Redact, then restore
Pick a language. Each sample is complete and runnable as-is; the docs test suite runs all three against the API.
# Needs curl and jq (preinstalled on macOS 15+; `apt install jq` on Debian/Ubuntu).
API=${OBSCATE_BASE_URL:-https://api.obscate.com}
# 2. Redact: fpe keeps formats and returns an empty token_map
curl -s "$API/v1/redact" \
-H "x-api-key: $OBSCATE_API_KEY" -H 'content-type: application/json' \
-d '{"text":"Refund card 4242 4242 4242 4242 for Priya Sharma, priya.sharma@example.com","strategy":"fpe"}' \
| tee redacted.json | jq '{redacted, token_map}'
# 3. Restore: send the redacted text (or a model reply that contains it) back
jq '{text: .redacted}' redacted.json \
| curl -s "$API/v1/restore-fpe" \
-H "x-api-key: $OBSCATE_API_KEY" -H 'content-type: application/json' -d @- \
| jq .text
# pip install requests
import os
import requests
API = os.environ.get("OBSCATE_BASE_URL", "https://api.obscate.com")
H = {"x-api-key": os.environ["OBSCATE_API_KEY"]}
text = "Refund card 4242 4242 4242 4242 for Priya Sharma, priya.sharma@example.com"
# Redact: fpe keeps formats and returns an empty token_map
r = requests.post(f"{API}/v1/redact", headers=H, json={"text": text, "strategy": "fpe"})
r.raise_for_status()
redacted = r.json()["redacted"]
print("send this to your LLM:", redacted)
# Restore: the key is all you need (restore calls are free)
r = requests.post(f"{API}/v1/restore-fpe", headers=H, json={"text": redacted})
r.raise_for_status()
restored = r.json()["text"]
print("restored:", restored)
assert restored == text
// Node 18+ (built-in fetch), no dependencies. Run: node quickstart.mjs
const API = process.env.OBSCATE_BASE_URL ?? "https://api.obscate.com";
const headers = { "x-api-key": process.env.OBSCATE_API_KEY, "content-type": "application/json" };
const post = async (path, body) => {
const res = await fetch(API + path, { method: "POST", headers, body: JSON.stringify(body) });
if (!res.ok) throw new Error(`${path}: HTTP ${res.status} ${await res.text()}`);
return res.json();
};
const text = "Refund card 4242 4242 4242 4242 for Priya Sharma, priya.sharma@example.com";
// Redact: fpe keeps formats and returns an empty token_map
const { redacted } = await post("/v1/redact", { text, strategy: "fpe" });
console.log("send this to your LLM:", redacted);
// Restore: the key is all you need (restore calls are free)
const { text: restored } = await post("/v1/restore-fpe", { text: redacted });
console.log("restored:", restored);
if (restored !== text) throw new Error("round trip failed");
Output (from a test instance; the hosted API produces different redacted values):
send this to your LLM: Refund card 9244 7815 4042 5941 for [PERSON:3bihtlnay7dpeoi7coukzsn23mu4brvsh6xhlvf7cqzgi], rwkbj.mprpta@wcrwbuh.com
restored: Refund card 4242 4242 4242 4242 for Priya Sharma, priya.sharma@example.com
What just happened. With "strategy": "fpe", the card became a different card number that still passes the Luhn check, the email stayed email-shaped, and the name became an authenticated [PERSON:…] token. token_map is {}: restore needs no map, and nothing is stored anywhere.
3. Put a model in the middle
In a real app, send redacted to your LLM or tool, and send its reply to /v1/restore-fpe. Tokens the model repeats come back as the real values.
Ask the model to repeat values whole. If it quotes only part of a redacted value (“card ending in 7588”), that fragment can’t be restored and shows your user wrong, real-looking digits. Add to your system prompt: “When you mention a card number, email or phone number, repeat it exactly and in full as given. Never abbreviate, mask or quote part of it.” Why, and what we measured.
One caveat for fpe: if the model invents a new email, card or phone number, key-only restore cannot tell it apart from a token and will transform it into a different value. Names and places are immune (authenticated tokens). If your model makes up contact details, use tokenize, which only replaces tokens in its map.
Storing tokens to restore later? Store key_version with them. Every redact response includes key_version. Pass it back to /v1/restore-fpe or /v1/restore-json when you restore. Round trips that finish in one flow need nothing extra, and the MCP, LangChain and LlamaIndex integrations carry it for you. Why restore doesn’t just try each version: an FF1 token decrypted under the wrong key doesn’t fail, it becomes a valid-looking but wrong value, so the caller has to say which version made it.
Next
- Redact a JSON tool call and restore the reply.
- Skip the HTTP calls with an integration: MCP, LangChain, LlamaIndex.
- Choose a strategy; the API default is
tokenize.