For developers

Context Eraser

Context Eraser removes private data from text before it reaches any AI. Send it a prompt and get the same text back with sensitive values overwritten by X.

What it removes

It detects personal and secret information such as:

  • Email addresses and phone numbers
  • People's names
  • API keys and access keys
  • Database connection strings and passwords

Request

POSThttps://ai-provider.rnetai.org/ai/sanitize-context
Content-Typetext/plain or application/json
BodyThe text (or JSON) to clean.
ResponseThe same body with sensitive spans replaced by X, in the same content type.
CreditsNo credits are charged.
bash
curl -X POST https://ai-provider.rnetai.org/ai/sanitize-context \
  -H "Content-Type: text/plain" \
  --data 'Reach me at rahul.sharma@acme.com. OpenAI key: sk-1234567890abcdef1234567890abcdef'
javascript
async function eraseContext(text) {
  const res = await fetch('https://ai-provider.rnetai.org/ai/sanitize-context', {
    method: 'POST',
    headers: { 'Content-Type': 'text/plain' },
    body: text,
  });
  if (!res.ok) throw new Error(`Context Eraser failed: ${res.status}`);
  return res.text();
}

const safePrompt = await eraseContext(userPrompt);
const response = await ai.chat({
  contents: [{ role: 'user', parts: [{ text: safePrompt }] }],
}, accessToken);
Call it before the model
Context Eraser is a separate step: AI requests are not cleaned automatically. Run user text through it, then send the cleaned text to /ai.

Limits

The endpoint shares the AI API rate limit of 100 requests per minute per IP address. Other content types return 400.