Base URL https://api.redactron.ai

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.

Quick start
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."}'
Response
{
  "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.

Header
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.

StatusTypeTypical codes
400invalid_request_errormissing_text invalid_json unknown_infotype missing_image missing_file
401authentication_errormissing_key invalid_key
404not_found_errornot_found job_not_found file_not_ready coming_soon
405invalid_request_errormethod_not_allowed
413invalid_request_errorpayload_too_large
415invalid_request_errorinvalid_content_type unsupported_media_type
429rate_limit_errorrate_limited
5xxapi_errorupstream_error upstream_timeout internal_error
Error body
{
  "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.

LimitValue
Text, polls, usage120 requests / minute
Image and audio uploads20 requests / minute
Text length200,000 characters (1 MB JSON body)
Image size20 MB · PNG, JPEG, WebP, BMP, TIFF
Audio size50 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.

Headers
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 42
X-Request-Id: req_6f1c0b9e2a4d4b1f8c3e7a10

Redact text

POST/v1/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 offsets start/end in the input. One span can carry several types (e.g. a full name and its first name).
type_countsobject
Count per category.
Request
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."}'
Response 200
{
  "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

POST/v1/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, and bbox as [x0, y0, x1, y1] pixels on your image.
countinteger
Number of boxes drawn.
Request
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
Response 200
{
  "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

POST/v1/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, or auto. Default en.
infotypesJSON array or comma list
As for text.
Request
curl https://api.redactron.ai/v1/redact/audio \
  -H "Authorization: Bearer $REDACTRON_KEY" \
  -F file=@call.wav -F language=en
Response 202
{
  "id": "cb97bc1bef624204abab8526598edec9",
  "object": "redaction.audio",
  "status": "queued",
  "poll": "/v1/redact/audio/cb97bc1bef624204abab8526598edec9"
}

Get an audio job

GET/v1/redact/audio/{id}

Returns the job's state. Only the key that started a job can read it. Poll every 5–15 s.

Returns

statusenum
queued, running, done or failed. While running, stage names 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 (CLEAN when nothing was missed) and pii_found.
redacted_audiostring
Path to download the bleeped audio.
Request
curl https://api.redactron.ai/v1/redact/audio/$JOB_ID \
  -H "Authorization: Bearer $REDACTRON_KEY"
Response 200
{
  "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

GET/v1/redact/audio/{id}/file

Streams the bleeped recording as WAV (16 kHz mono). 404 file_not_ready until the job is done.

Request
curl -o redacted.wav \
  https://api.redactron.ai/v1/redact/audio/$JOB_ID/file \
  -H "Authorization: Bearer $REDACTRON_KEY"

Usage

GET/v1/usage?days=30

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.

Response 200
{
  "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

GET/v1/infotypes

Lists the 271 categories you can pass as infotypes, with the default set. No key needed. Common ones:

PERSON_NAMEFull names; FIRST_NAME, LAST_NAME for parts
PHONE_NUMBER EMAIL_ADDRESSContact details
STREET_ADDRESS LOCATIONAddresses and places
DATE_OF_BIRTH DATE AGEDates and ages
CANADA_OHIP CANADA_SOCIAL_INSURANCE_NUMBERCanadian health and SIN numbers
MEDICAL_RECORD_NUMBER MEDICAL_IDClinical identifiers
CUSTOM:<label>Your own category, described by its label
Request
curl https://api.redactron.ai/v1/infotypes

Chat completions Coming

POST/v1/chat/completions

OpenAI-compatible LLM inference on the same private GPUs, with the same key. Until it opens, this route answers 404 with code coming_soon.

Response 404 (today)
{
  "error": {
    "type": "not_found_error",
    "code": "coming_soon",
    "message": "Inference (/v1/chat/completions) is coming soon on this API."
  }
}