API reference
Find and remove personal data in text, scanned pages and calls. Every request runs on private GPUs; nothing is kept after the result is returned.
The API is REST over HTTPS. Requests take JSON or multipart/form-data; every response is JSON, except the redacted audio download. An OpenAPI 3.1 spec describes every route.
curl https://api.redactron.ai/v1/redact/text \
-H "Authorization: Bearer $REDACTRON_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Call Maria Lopez at 416-555-0199."}'{
"redacted_text": "Call [REDACTED:PERSON_NAME] at [REDACTED:PHONE_NUMBER].",
…
}Authentication
Send your secret key as a bearer token on every request. Keys start with rk_. Only a hash of the key is stored, so a lost key cannot be shown again — ask for a new one and the old one is revoked (within a minute).
Keep keys on your server. A missing key returns 401 missing_key; an unknown or revoked key returns 401 invalid_key.
Each response carries an X-Request-Id header (also in error bodies). Send your own X-Request-Id (8–64 of A–Z a–z 0–9 _ . -) to tie our logs to yours.
Authorization: Bearer rk_…
Errors
Errors use HTTP status codes and one JSON shape. type is the class, code is stable for your code to branch on, message is for people.
| Status | Type | Typical codes |
|---|---|---|
| 400 | invalid_request_error | missing_text invalid_json unknown_infotype missing_image missing_file |
| 401 | authentication_error | missing_key invalid_key |
| 404 | not_found_error | not_found job_not_found file_not_ready coming_soon |
| 405 | invalid_request_error | method_not_allowed |
| 413 | invalid_request_error | payload_too_large |
| 415 | invalid_request_error | invalid_content_type unsupported_media_type |
| 429 | rate_limit_error | rate_limited |
| 5xx | api_error | upstream_error upstream_timeout internal_error |
{
"error": {
"type": "invalid_request_error",
"code": "missing_text",
"message": "Field `text` is required",
"request_id": "req_6f1c0b9e2a4d4b1f8c3e7a10"
}
}Limits
Rate limits are per key, per minute. Every authenticated response tells you where you stand; a 429 adds Retry-After in seconds.
| Limit | Value |
|---|---|
| Text, polls, usage | 120 requests / minute |
| Image and audio uploads | 20 requests / minute |
| Text length | 200,000 characters (1 MB JSON body) |
| Image size | 20 MB · PNG, JPEG, WebP, BMP, TIFF |
| Audio size | 50 MB · WAV, MP3, M4A, AAC, FLAC, OGG, WMA |
Browsers may call the API directly (CORS is open), but that exposes your key — prefer calling from your server.
X-RateLimit-Limit: 120 X-RateLimit-Remaining: 117 X-RateLimit-Reset: 42 X-Request-Id: req_6f1c0b9e2a4d4b1f8c3e7a10
Redact text
Finds personal data in plain text and returns the text with each item replaced by [REDACTED:TYPE], plus where each item was. Typically 3–10 s.
Body (JSON)
- textstringrequired
- Up to 200,000 characters.
- infotypesarray of strings
- Categories to find, e.g.
["PERSON_NAME","PHONE_NUMBER"]. Defaults to 18 common ones. See categories;CUSTOM:<label>asks for your own.
Returns
- redacted_textstring
- Input with each found item replaced.
- entitiesarray
type,text, and character offsetsstart/endin the input. One span can carry several types (e.g. a full name and its first name).- type_countsobject
- Count per category.
curl https://api.redactron.ai/v1/redact/text \
-H "Authorization: Bearer $REDACTRON_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Patient John Smith, DOB 1980-03-04, phone 416-555-0199."}'
import os, requests
r = requests.post(
"https://api.redactron.ai/v1/redact/text",
headers={"Authorization": f"Bearer {os.environ['REDACTRON_KEY']}"},
json={"text": "Patient John Smith, DOB 1980-03-04, phone 416-555-0199."},
timeout=120,
)
r.raise_for_status()
print(r.json()["redacted_text"])
const r = await fetch("https://api.redactron.ai/v1/redact/text", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REDACTRON_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "Patient John Smith, DOB 1980-03-04, phone 416-555-0199." }),
});
console.log((await r.json()).redacted_text);{
"id": "req_9d2b7c1e4f6a4c0e9b8d3f21",
"object": "redaction.text",
"redacted_text": "Patient [REDACTED:PERSON_NAME], DOB [REDACTED:DATE], phone [REDACTED:PHONE_NUMBER].",
"entities": [
{ "type": "PERSON_NAME", "text": "John Smith", "start": 8, "end": 18 },
{ "type": "DATE_OF_BIRTH", "text": "1980-03-04", "start": 24, "end": 34 },
{ "type": "PHONE_NUMBER", "text": "416-555-0199", "start": 42, "end": 54 }
],
"type_counts": { "PERSON_NAME": 1, "DATE_OF_BIRTH": 1, "PHONE_NUMBER": 1 },
"timing_s": 6.9
}Redact image
Reads a scanned or photographed page, finds personal data, and returns the page with black boxes drawn over it plus each item's box. Typically 30–160 s; keep your HTTP timeout at 5 minutes or more.
Body (multipart/form-data)
- imagefilerequired
- PNG, JPEG, WebP, BMP or TIFF, up to 20 MB. One page per request.
- infotypesJSON array or comma list
- As for text.
Returns
- redacted_imagestring
- PNG as a
data:image/png;base64,…URI. - entitiesarray
type,text, andbboxas[x0, y0, x1, y1]pixels on your image.- countinteger
- Number of boxes drawn.
curl https://api.redactron.ai/v1/redact/image \ -H "Authorization: Bearer $REDACTRON_KEY" \ -F image=@intake_form.png \ -F 'infotypes=["PERSON_NAME","PHONE_NUMBER","CANADA_OHIP"]' \ --max-time 300
import base64, os, requests
with open("intake_form.png", "rb") as f:
r = requests.post(
"https://api.redactron.ai/v1/redact/image",
headers={"Authorization": f"Bearer {os.environ['REDACTRON_KEY']}"},
files={"image": f},
timeout=300,
)
r.raise_for_status()
d = r.json()
open("redacted.png", "wb").write(base64.b64decode(d["redacted_image"].split(",", 1)[1]))
import { readFile, writeFile } from "node:fs/promises";
const form = new FormData();
form.set("image", new Blob([await readFile("intake_form.png")]), "intake_form.png");
const r = await fetch("https://api.redactron.ai/v1/redact/image", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.REDACTRON_KEY}` },
body: form,
});
const d = await r.json();
await writeFile("redacted.png", Buffer.from(d.redacted_image.split(",")[1], "base64"));{
"id": "req_1a7f3e0c5b9d4e2f8a6c0d14",
"object": "redaction.image",
"entities": [
{ "type": "PERSON_NAME", "text": "Anthony Kowalski", "bbox": [142, 141, 326, 165] },
{ "type": "LOCATION", "text": "90 Lakeshore Rd E, Mississauga ON", "bbox": [56, 252, 627, 276] }
],
"count": 15,
"redacted_image": "data:image/png;base64,iVBORw0KGgo…",
"timing_s": 56.8
}Redact audio
Starts a job that transcribes the recording, finds personal data, and bleeps it out of the audio. Returns 202 at once with a job id; poll the job until status is done. A 30 s clip takes about 40 s.
Body (multipart/form-data)
- filefilerequired
- WAV, MP3, M4A, AAC, FLAC, OGG or WMA, up to 50 MB.
- languagestring
- ISO-639 code such as
en,fr,ar, orauto. Defaulten. - infotypesJSON array or comma list
- As for text.
curl https://api.redactron.ai/v1/redact/audio \ -H "Authorization: Bearer $REDACTRON_KEY" \ -F file=@call.wav -F language=en
import os, time, requests
H = {"Authorization": f"Bearer {os.environ['REDACTRON_KEY']}"}
B = "https://api.redactron.ai"
with open("call.wav", "rb") as f:
job = requests.post(f"{B}/v1/redact/audio", headers=H,
files={"file": f}, data={"language": "en"}).json()
while (d := requests.get(f"{B}/v1/redact/audio/{job['id']}", headers=H).json())["status"] in ("queued", "running"):
time.sleep(10)
print(d["redacted_transcript"])
open("redacted.wav", "wb").write(requests.get(B + d["redacted_audio"], headers=H).content)
import { readFile, writeFile } from "node:fs/promises";
const B = "https://api.redactron.ai";
const H = { Authorization: `Bearer ${process.env.REDACTRON_KEY}` };
const form = new FormData();
form.set("file", new Blob([await readFile("call.wav")]), "call.wav");
const job = await (await fetch(`${B}/v1/redact/audio`, { method: "POST", headers: H, body: form })).json();
let d;
do {
await new Promise((r) => setTimeout(r, 10_000));
d = await (await fetch(`${B}/v1/redact/audio/${job.id}`, { headers: H })).json();
} while (d.status === "queued" || d.status === "running");
await writeFile("redacted.wav", Buffer.from(await (await fetch(B + d.redacted_audio, { headers: H })).arrayBuffer()));{
"id": "cb97bc1bef624204abab8526598edec9",
"object": "redaction.audio",
"status": "queued",
"poll": "/v1/redact/audio/cb97bc1bef624204abab8526598edec9"
}Get an audio job
Returns the job's state. Only the key that started a job can read it. Poll every 5–15 s.
Returns
- statusenum
queued,running,doneorfailed. While running,stagenames the step.- transcriptstring
- Full transcript (done only).
- redacted_transcriptstring
- Transcript with
[REDACTED:TYPE]markers. - entitiesarray
type,text,start_s,end_s(seconds in the audio),score.- verificationobject
- Second-pass check of the redacted transcript:
status(CLEANwhen nothing was missed) andpii_found. - redacted_audiostring
- Path to download the bleeped audio.
curl https://api.redactron.ai/v1/redact/audio/$JOB_ID \ -H "Authorization: Bearer $REDACTRON_KEY"
{
"id": "cb97bc1bef624204abab8526598edec9",
"object": "redaction.audio",
"status": "done",
"language": "en",
"transcript": "Okay. So Larissa, as I mentioned to you…",
"redacted_transcript": "Okay. So [REDACTED:FIRST_NAME], as I mentioned to you…",
"entities": [
{ "type": "FIRST_NAME", "text": "Larissa", "start_s": 3.76, "end_s": 4.32, "score": 1.0 }
],
"verification": { "status": "CLEAN", "pii_found": false },
"redacted_audio": "/v1/redact/audio/cb97bc1bef624204abab8526598edec9/file"
}Download redacted audio
Streams the bleeped recording as WAV (16 kHz mono). 404 file_not_ready until the job is done.
curl -o redacted.wav \ https://api.redactron.ai/v1/redact/audio/$JOB_ID/file \ -H "Authorization: Bearer $REDACTRON_KEY"
Usage
Your key's daily counts per route, newest days included, up to 90 days. calls counts every request, ok the ones that succeeded, and units what was processed: characters for text, pages for images, files for audio.
{
"object": "list",
"key_name": "acme-prod",
"days": 30,
"data": [
{ "date": "2026-12-05", "route": "text", "calls": 42, "ok": 41, "units": 18230 },
{ "date": "2026-12-05", "route": "image", "calls": 3, "ok": 3, "units": 3 }
]
}Categories
Lists the 271 categories you can pass as infotypes, with the default set. No key needed. Common ones:
PERSON_NAME | Full names; FIRST_NAME, LAST_NAME for parts |
PHONE_NUMBER EMAIL_ADDRESS | Contact details |
STREET_ADDRESS LOCATION | Addresses and places |
DATE_OF_BIRTH DATE AGE | Dates and ages |
CANADA_OHIP CANADA_SOCIAL_INSURANCE_NUMBER | Canadian health and SIN numbers |
MEDICAL_RECORD_NUMBER MEDICAL_ID | Clinical identifiers |
CUSTOM:<label> | Your own category, described by its label |
curl https://api.redactron.ai/v1/infotypes
Chat completions Coming
OpenAI-compatible LLM inference on the same private GPUs, with the same key. Until it opens, this route answers 404 with code coming_soon.
{
"error": {
"type": "not_found_error",
"code": "coming_soon",
"message": "Inference (/v1/chat/completions) is coming soon on this API."
}
}