ReRanDE API Documentation

Deterministic clinical text correction API.

Integrate ReRanDE as a narrow correction layer for clinical text normalization, domain routing, correction evidence, audit metadata, and structured JSON responses.

Base URL https://rerande.nextnlp.com Primary endpoint POST /check Content type application/json
01

Quickstart

Send clinical text to POST /check with a response mode. Production integrations should include an API key using the Authorization header.

curl -X POST "https://rerande.nextnlp.com/check" \
  -H "Authorization: Bearer $RERANDE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "text": "The patient developed tachycarda and chest discomfrt.",
    "mode": "text",
    "language": "en",
    "options": {
      "include_original": true,
      "include_billing": true
    }
  }'
02

Authentication

Use bearer-token authentication for production API access. Keep keys server-side and never expose them in browser JavaScript, mobile binaries, client logs, or public repositories.

Header format Authorization: Bearer YOUR_RERANDE_API_KEY
export RERANDE_API_KEY="rerande_live_xxxxxxxxxxxxx"

curl -X POST "https://rerande.nextnlp.com/check" \
  -H "Authorization: Bearer $RERANDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Patient admited with dyspniya.","mode":"elite"}'

Server-side only

Proxy browser and mobile traffic through your own backend so API keys remain private.

Rotate keys

Use separate keys for evaluation, staging, and production environments.

Log safely

Do not log API keys, submitted clinical text, or corrected clinical output.

03

Endpoint

POST https://rerande.nextnlp.com/check

The endpoint accepts a JSON body and returns a JSON response shaped by the selected mode. ReRanDE does not diagnose, recommend treatment, or generate new clinical meaning.

04

Request schema

FieldTypeRequiredDescription
textstringYesClinical text to inspect and correct. Empty text returns 400.
modeenumNoOne of domain, lite, text, elite, full, audit, debug. Default: elite.
languagestringNoLanguage hint. Public examples use en.
options.top_k_domainsintegerNoNumber of ranked domains returned where supported. Default: 5.
options.include_originalbooleanNoInclude original text in modes that support it. Default: true.
options.include_billingbooleanNoInclude SmartCredit usage in supported modes. Audit and debug include billing by default.
debugbooleanNoCompatibility flag for internal diagnostic pathways. Prefer mode: "debug".
05

Response modes

Use the smallest response contract that gives your workflow enough evidence. Start with text or elite; move to full, audit, or debug when traceability or diagnostics are required.

domain

Domain routing only. Returns detected clinical domain and ranked alternatives.

lite

Minimal correction response. Returns corrected text and correction count.

text

Text contract for forms, databases, and search indexes. Returns original text, corrected text, and correction map.

elite

Production integration contract. Returns domain, corrected text, structured corrections, and summary.

full

Explainability contract. Returns domain, text object, corrections with positions, and risk summary.

audit

Traceability contract. Returns engine metadata, original text hash, correction marks, performance, and billing.

debug

Diagnostic contract. Returns full response plus pipeline stages, candidate data, and debug payload.

06

Examples

Python with API authentication

import os
import requests

url = "https://rerande.nextnlp.com/check"
headers = {
    "Authorization": f"Bearer {os.environ['RERANDE_API_KEY']}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}
payload = {
    "text": "The patient developed tachycarda and chest discomfrt.",
    "mode": "text",
    "language": "en",
    "options": {"include_original": True, "include_billing": True},
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()
print(data["corrected_text"])
print(data["corrections"])

Node.js server-side fetch

const response = await fetch("https://rerande.nextnlp.com/check", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.RERANDE_API_KEY}`,
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    text: "Initial electrocardiogrm showed ST elevaton.",
    mode: "elite",
    language: "en",
    options: { include_original: true, include_billing: true }
  })
});

if (!response.ok) {
  throw new Error(`ReRanDE request failed: ${response.status}`);
}

const data = await response.json();
console.log(data.domain, data.summary);

Domain-only routing

curl -X POST "https://rerande.nextnlp.com/check" \
  -H "Authorization: Bearer $RERANDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Clinical features include wheezing, bronchospasm, and inhaler response.",
    "mode": "domain",
    "options": {"top_k_domains": 3}
  }'
07

Response shapes

text response

{
  "mode": "text",
  "request_id": "67a441b9-95fe-41ff-b0e2-f585f36c8f15",
  "original_text": "The patient developed tachycarda and chest discomfrt.",
  "corrected_text": "The patient developed tachycardia and chest discomfort.",
  "corrections": {
    "tachycarda": "tachycardia",
    "discomfrt": "discomfort"
  },
  "billing": {
    "unit": "SmartCredit",
    "credits_used": 57
  }
}

audit response

{
  "mode": "audit",
  "request_id": "req_...",
  "engine": {
    "version": "gold-v...",
    "lexicon_version": "pkl-live",
    "timestamp": "2026-06-29T..."
  },
  "domain": "CARDIOLOGY",
  "text": {
    "original_hash": "sha256:...",
    "corrected_text": "The patient developed tachycardia."
  },
  "corrections": [
    {"original": "tachycarda", "corrected": "tachycardia", "confidence": 0.96}
  ],
  "performance": {"execution_time_ms": 18},
  "billing": {"unit": "SmartCredit", "credits_used": 241}
}
08

Errors

StatusMeaningAction
200Request processed successfully.Read the response according to the selected mode.
400Input text is empty.Send a non-empty text field.
401Missing or invalid API key in protected environments.Send Authorization: Bearer YOUR_KEY.
403Key is valid but not authorized for the requested environment or plan.Check workspace, plan, and deployment agreement.
422Request schema validation failed.Check field types and supported mode names.
429Rate or quota limit reached.Retry with backoff or upgrade the SmartCredit pack.
5xxServer-side processing error.Retry with exponential backoff and preserve request_id.
09

Billing and SmartCredits

ReRanDE uses SmartCredits to meter API usage. Input-only contracts are priced by submitted characters. Explainability-heavy contracts include response size because they return additional structured metadata.

domain, lite, text, elite

input characters

full, audit, debug

input characters + output characters / 3

Billing visibility

Set options.include_billing to true where supported.

10

Security and data handling

HTTPS/TLS

Use encrypted transport for all production traffic.

Authentication

Use bearer-token API access for production environments.

AWS infrastructure

Enterprise deployment planning can align with AWS-hosted operational controls.

No submitted text retention

Submitted text should be treated as transient request content.

No correction output storage

Corrected clinical text is returned to the caller without becoming a stored corpus.

No clinical content logs

Operational logging should avoid submitted clinical content and corrected output.

HIPAA-regulated organizations should use ReRanDE only under an appropriate enterprise agreement and deployment model.

11

Limits and integration guidance

  • Use server-side calls for authenticated production traffic.
  • Choose the smallest response mode that satisfies the workflow.
  • Use request_id for support and operational tracing.
  • Use timeout and retry logic with exponential backoff for 5xx responses.
  • Do not send PHI unless your organization has the required agreement and deployment model.
12

Support

For production access, enterprise deployment review, or private rollout planning, contact the ReRanDE team.

Contact support