Official SDKs & Libraries

Build with Redact

Get started in minutes with our official Python SDK, npm package, and REST API. Full type hints, automatic retries, and batch processing built-in.

📦
JavaScript / Node.js

TypeScript support with full type definitions. Works with Node.js 16+ and modern browsers.

npm install @redact/proxy
  • TypeScript definitions included
  • Promise-based API
  • Browser & Node.js support
  • ESM & CommonJS
🌐
REST API

Direct HTTP access for any language. OpenAPI spec available for code generation.

api.redact.health/v1
  • OpenAPI 3.0 specification
  • JSON request/response
  • Bearer token auth
  • Rate limiting headers

Code Examples

Copy and paste to get started. All examples use the same API patterns.

Python
JavaScript
cURL
# Just change one import - that's it!
from redact_proxy import OpenAI  # instead of: from openai import OpenAI

client = OpenAI()  # Uses OPENAI_API_KEY from env

# Your existing code works unchanged
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{
        "role": "user",
        "content": "Summarize: Patient John Smith, DOB 01/15/1980, has diabetes."
    }]
)

# PHI is automatically redacted before reaching OpenAI
# OpenAI sees: "Patient [PATIENT_a1b2c3], DOB [DATE_d4e5f6], has diabetes."
print(response.choices[0].message.content)
import { OpenAI } from '@redact/proxy';

const client = new OpenAI();

// Your existing code works unchanged
const response = await client.chat.completions.create({
    model: 'gpt-4',
    messages: [{
        role: 'user',
        content: 'Summarize: Patient John Smith, DOB 01/15/1980, has diabetes.'
    }]
});

// PHI is automatically redacted before reaching OpenAI
console.log(response.choices[0].message.content);
# Direct REST API call
curl -X POST https://api.redact.health/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-LLM-Provider: openai" \
  -d '{
    "model": "gpt-4",
    "messages": [{
      "role": "user",
      "content": "Summarize: Patient John Smith, DOB 01/15/1980, has diabetes."
    }]
  }'

# Response includes redacted PHI info in headers
# X-Redact-PHI-Found: 2
# X-Redact-Document-ID: doc_xyz789
RECOMMENDED

Start with Redact-Proxy

Our drop-in SDK replacement is the fastest way to add HIPAA compliance to your LLM app. One import change, zero code refactoring. Works with OpenAI, Anthropic, and Gemini.

Learn About Redact-Proxy →