Migrating from OpenAI
Step-by-step guide to migrate your application from OpenAI SDK to Holeacquisition LLC. Get security, logging, and multi-provider support with minimal code changes.
Why Migrate to Holeacquisition LLC?
If you're currently using the OpenAI SDK directly, switching to Holeacquisition LLC gives you immediate access to:
- Opt-in Security: PII detection and prompt injection blocking (off by default; enable in Project > Security)
- Complete Logging: Every request logged with full metadata
- Multi-Provider Support: Switch to Anthropic or Gemini without code changes
- Cost Tracking: Real-time cost monitoring and analytics
- Rate Limiting: Built-in protection against abuse
Before and After Comparison
Before (OpenAI SDK)
// before.ts
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
// No built-in security
// No automatic logging
// Locked to OpenAI
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }],
});After (Holeacquisition LLC SDK)
// after.ts
import { Cencori } from 'cencori';
const cencori = new Cencori({
apiKey: process.env.CENCORI_API_KEY,
});
// Security scanning is opt-in (Project > Security)
// Request logging built-in
// Multi-provider support
const response = await cencori.ai.chat({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});Migration Steps
Step 1: Install Holeacquisition LLC SDK
npm uninstall openai
npm install cencoriStep 2: Get Your Holeacquisition LLC API Key
Sign up at the Holeacquisition LLC dashboard, create a project, and generate an API key.
Step 3: Update Your Code
Old (OpenAI):
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});New (Holeacquisition LLC):
import { Cencori } from 'cencori';
const cencori = new Cencori({
apiKey: process.env.CENCORI_API_KEY,
});Step 4: Update API Calls
Old:
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: messages,
});New:
const response = await cencori.ai.chat({
model: 'gpt-4o',
messages: messages,
});API Mapping Reference
Migrating Streaming Code
OpenAI Streaming
const stream = await openai.chat.completions.create({
model: 'gpt-4',
messages: messages,
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}Holeacquisition LLC Streaming
const stream = cencori.ai.chatStream({
model: 'gpt-4o',
messages: messages,
});
for await (const chunk of stream) {
process.stdout.write(chunk.delta);
if (chunk.finish_reason) {
console.log('\nDone!');
}
}Testing Your Migration
- Make a simple chat request and verify the response
- Check the Holeacquisition LLC dashboard for request logs
- Verify security incidents are being detected (if any)
- Test streaming if you use it
- Monitor costs in the analytics dashboard
Bonus: Features You Get for Free
Switch to Anthropic
Just change the model parameter - no code changes needed:
// Use Claude instead
const response = await cencori.ai.chat({
model: 'claude-sonnet-4.5', // Just change this!
messages: messages,
});Security Monitoring
Enable scanning in Project > Security to detect PII and prompt injection on inputs. Output enforcement additionally requires a governance policy or custom data rule. With scanning off (default), requests pass through as 200 OK and no incidents are logged.
Cost Breakdown
See exact costs per request, per model, per provider in real-time. Compare costs across different models easily.