Skip to main content
CID222Documentation

Quickstart Guide

Get CID222 up and running in under 5 minutes. This guide will walk you through the essential steps to start protecting your AI applications.

Prerequisites

  • A CID222 account with API access
  • Your API key from the dashboard
  • An existing LLM provider key (OpenAI, Anthropic, etc.)

Step 1: Get Your API Key

Log in to your CID222 dashboard and navigate to Settings → API Keys. Create a new API key and copy it securely.

Keep Your Key Secure

Never expose your API key in client-side code or public repositories. Use environment variables to store sensitive credentials.
Set Environment Variable
export CID222_API_KEY="your-api-key-here"

Step 2: Configure Your LLM Provider

Add your LLM provider credentials in the dashboard under Settings → Credentials. CID222 will use these to forward requests to your AI provider.

Step 3: Make Your First Request

Replace your existing LLM API endpoint with the CID222 endpoint. The request format remains the same—CID222 is fully compatible with OpenAI's API format.

JavaScript Example
1const response = await fetch('https://api.cid222.ai/chat/completions', {
2 method: 'POST',
3 headers: {
4 'Authorization': 'Bearer ' + process.env.CID222_API_KEY,
5 'Content-Type': 'application/json',
6 },
7 body: JSON.stringify({
8 model: 'gpt-4',
9 messages: [
10 {
11 role: 'user',
12 content: 'Summarize this customer feedback: Great product! ' +
13 'Contact me at john.smith@company.com or 555-123-4567'
14 }
15 ]
16 })
17});
18
19const data = await response.json();
20console.log(data.choices[0].message.content);

What Happens Behind the Scenes

CID222 automatically detected the email and phone number in the message, masked them before sending to the LLM, and returned the response. Your sensitive data never reached the AI provider.

Step 4: Verify Detection

Check your CID222 dashboard to see the detection logs. You'll see:

  • Original content with PII highlighted
  • Masked version sent to the LLM
  • Entity types detected (EMAIL, PHONE)
  • Confidence scores for each detection

Using Sessions (Optional)

For conversational applications, use sessions to maintain context across multiple messages:

Session-Based Chat
// Create a session
const sessionRes = await fetch('https://api.cid222.ai/sessions', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.CID222_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
provider: 'openai',
model: 'gpt-4',
metadata: { user_id: 'user-123' }
})
});
const session = await sessionRes.json();
// Send messages in the session
const messageRes = await fetch(
`https://api.cid222.ai/sessions/${session.id}/messages`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.CID222_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Hello, I need help with my account'
})
}
);

Next Steps