§ LLM round trip
Restore PII API
Takes the model’s answer and your mapping, and returns the answer with the real values in it. The mapping travels as its own part rather than inside options, because options are capped at 64KB across the service and a real mapping passes that long before the token ceiling does. The response also tells you which tokens the model dropped and which ones it invented.
- Endpoint
- POST /text/restore
- Inputs
- Exactly 1 UTF-8 text file
- Aux part
- mapping — the JSON object /text/tokenize returned
- Returns
- application/json
- Limits
- 2 MB per file, 5,000 tokens per mapping.
- Price
- $0.001
§ 01 The request
One POST, and the file comes back.
curl -sS --fail-with-body \
-H "Authorization: Bearer $OHMYWRAP_KEY" \
-F "file=@reply.txt" \
-F "mapping=@mapping.json" \
-F 'options={"tokenFormat":"[%T_%n]"}' \
https://api.ohmywrap.com/text/restoreOptions
| Option | Type | Default | What it does |
|---|---|---|---|
| tokenFormat | string | — | Optional for the substitution, required for the `unknown` list: without it there is no way to tell a token the model invented from ordinary prose. |
Worth knowing
You could do this yourself, and it is a substitution over a map you already hold. What the endpoint adds is those two lists and correct ordering when one token is a prefix of another — the bug where `PII_1` eats the front of `PII_11`. A round trip is two calls: tokenize, then restore.
Your first /text/restore call takes one line of curl.
Ten thousand calls cost ten dollars, the pack never expires, and nothing you send is kept.
10,000 calls for $10. No subscription, no expiry.