The masking, as an API.
Your code sends text as it is. Names, addresses and numbers are replaced with placeholders before a model sees them, and put back in the answer. The API speaks the OpenAI format, so changing the address and the key is the whole integration.
{
"model": "auto",
"messages": [{
"role": "user",
"content": "Reply to Ana Novak, tax number 41270517, about invoice 2024-117."
}]
}{
"messages": [{
"role": "user",
"content": "Reply to [PERSON_1], tax number [TAX_ID_1], about invoice 2024-117."
}]
}{
"choices": [{
"message": {
"role": "assistant",
"content": "Dear Ms Novak, thank you for your patience regarding invoice 2024-117 ..."
}
}]
}Three endpoints
Everything goes through the same masking as the chat, with the same rules, measurements and audit trail.
Start in a minute
A company admin creates a key in the console. Keep it on your servers; each key can have its own monthly cap and can be revoked at any time.
- Sessions
- Send back the X-Session-Id header and a person keeps one placeholder for the whole conversation.
- Streaming
- Server-sent events in the OpenAI format; placeholders are restored as the text arrives.
- Fail closed
- If the masking cannot run, nothing is sent and you get 503.
from openai import OpenAI
client = OpenAI(base_url="https://api.gdprprompt.ai/v1",
api_key="eucc_sk_…")
reply = client.chat.completions.create(
model="auto",
messages=[{"role": "user",
"content": "Reply to Ana Novak about invoice 2024-117."}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.gdprprompt.ai/v1",
apiKey: "eucc_sk_…",
});
const reply = await client.chat.completions.create({
model: "auto",
messages: [
{ role: "user", content: "Reply to Ana Novak about invoice 2024-117." },
],
});
console.log(reply.choices[0].message.content);curl https://api.gdprprompt.ai/v1/chat/completions \
-H "Authorization: Bearer eucc_sk_…" \
-H "Content-Type: application/json" \
-d '{"model": "auto", "messages": [{"role": "user",
"content": "Reply to Ana Novak about invoice 2024-117."}]}'