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
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.
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});1819const data = await response.json();20console.log(data.choices[0].message.content);
What Happens Behind the Scenes
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:
// Create a sessionconst 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 sessionconst 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
- Learn about authentication — Understand JWT tokens and API key management
- Explore the API — Full API reference with all endpoints
- Content Safety Pipeline — How detection and masking works