Home/Docs/API Reference

REST API reference

Industrial API specification for integrating internal applications, LLM agents, and microservices with the RedactNode Gateway.

Updated Sep 17, 2026
||View API spec

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.

Base URL: https://gateway.internal.firm/v1
Authorization HeaderPass your generated secret key in the request header: Authorization: Bearer rn_live_...
POST

/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

FIELDTYPEREQUIREDDESCRIPTION
modelstringrequiredTarget model: gpt-4o, claude-3-5-sonnet, gemini-1.5-pro
messagesarrayrequiredArray of message objects with role and content
streambooleanoptionalStream tokens via Server-Sent Events (default: false)
cURL ExampleBASH
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."
      }
    ]
  }'
POST

/v1/redact

Direct sanitization endpoint. Redacts text and returns deterministic surrogate tokens with cryptographic SHA-256 audit digests.

Response Payload200 OK
{
  "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..."
}
POST

/v1/restore

De-tokenizes text containing surrogate tokens using an authorized session vault ID before RAM TTL expiry.

GET

/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:

STATUSCODEREASON
400BAD_REQUESTMalformed JSON payload or invalid parameter type
401UNAUTHORIZEDMissing or invalid Bearer API token
403POLICY_BLOCKEDPrompt violated an enterprise hard-block rule
502UPSTREAM_TIMEOUTUpstream foundation model failed to respond in time