REST API reference
Industrial API specification for integrating internal applications, LLM agents, and microservices with the RedactNode Gateway.
1. Overview & Base URL
The RedactNode Gateway exposes an OpenAI-compatible REST API. All requests must be authenticated using an API Bearer token and formatted as JSON.
Authorization: Bearer rn_live_.../v1/chat/completions
The core proxy endpoint. Incoming prompts are inspected in under 2ms. Detected Malaysian PII entities are replaced with deterministic surrogate tokens, forwarded to upstream LLMs, and completions are re-hydrated transparently before return.
Request Body Parameters
| FIELD | TYPE | REQUIRED | DESCRIPTION |
|---|---|---|---|
| model | string | required | Target model: gpt-4o, claude-3-5-sonnet, gemini-1.5-pro |
| messages | array | required | Array of message objects with role and content |
| stream | boolean | optional | Stream tokens via Server-Sent Events (default: false) |
curl -X POST https://gateway.internal.firm/v1/chat/completions \
-H "Authorization: Bearer $REDACTNODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Assess borrower MyKad 850315-14-5521 with salary RM 14,000."
}
]
}'/v1/redact
Direct sanitization endpoint. Redacts text and returns deterministic surrogate tokens with cryptographic SHA-256 audit digests.
{
"sanitized_text": "Contact customer at [TELCO_TOKEN_012348] regarding [BANK_TOKEN_514012].",
"entities_found": [
{ "entity": "phone", "token": "TELCO_TOKEN_012348", "original_preview": "012-348 9912" },
{ "entity": "bank_account", "token": "BANK_TOKEN_514012", "original_preview": "514012984102" }
],
"session_vault_id": "vault_6b12a8",
"audit_digest": "sha256:7f01a9b2c83d4e..."
}/v1/restore
De-tokenizes text containing surrogate tokens using an authorized session vault ID before RAM TTL expiry.
/v1/health
Kubernetes readiness and liveness probe checking Redis vault connectivity, active session counts, and rule engine latency.
6. Error Handling & RFC 7807
Standard HTTP error status codes returned by the gateway:
| STATUS | CODE | REASON |
|---|---|---|
| 400 | BAD_REQUEST | Malformed JSON payload or invalid parameter type |
| 401 | UNAUTHORIZED | Missing or invalid Bearer API token |
| 403 | POLICY_BLOCKED | Prompt violated an enterprise hard-block rule |
| 502 | UPSTREAM_TIMEOUT | Upstream foundation model failed to respond in time |
