AI Chat
AI Chat
Send a prompt to an LLM with automatic PII encoding/decoding. The prompt is encoded before reaching the LLM, and the LLM's response is decoded back to original values.
The full pipeline is:
- Your prompt is scanned for PII
- PII is replaced with Privacy Twins
- The encoded prompt is sent to the LLM
- The LLM response (containing Privacy Twins) is decoded
- You receive both the raw LLM response and the decoded version
SDK Usage:
const result = await client.chatWithAI({
prompt: 'Analyze credit history for John Doe at john@company.com',
model: 'gemini-2.0-flash-exp',
provider: 'vertex'
});
post/api/ai/chat
Request body
Example request
{
"prompt": "Analyze credit history for John Doe at john@company.com",
"model": "gemini-2.0-flash-exp",
"provider": "vertex"
}Response
AI chat response with decoded PII
Example response
{
"encoding": {
"transformations": [
{
"components": [
{
"original": "John",
"twin": "Maria",
"type": "FIRST_NAME"
}
]
}
]
}
}