Installation
Install and configure the Cencori SDK for your preferred language.
Requirements
- Node.js: Version 18.0.0 or higher
- Package Manager: npm 8+, yarn 1.22+, or pnpm 7+
- TypeScript: Version 4.5+ (optional but recommended)
Installation
Vercel AI SDK Integration
Using Vercel AI SDK? Install the Cencori provider for seamless integration with streamText(), generateText(), and useChat():
Same benefits: Safety filtering, analytics, cost tracking, and multi-provider support — all through the familiar Vercel AI SDK patterns.
TanStack AI Integration
Using TanStack AI? Install the Cencori adapter with TanStack AI:
Full features: Streaming, structured output, and tool calling — all routed through Cencori's unified gateway.
SDK Initialization
Basic Usage
Streaming Responses
Error Handling
Environment Setup
Store your API key securely using environment variables:
Security: Never commit your .env file to version control. Add it to your .gitignore.
Supported Providers & Models
All SDKs support 14+ providers with 50+ models:
| Provider | Key Models |
|---|---|
| OpenAI | gpt-5, gpt-4o, gpt-4o-mini, o3, o1 |
| Anthropic | claude-opus-4, claude-sonnet-4, claude-3-5-sonnet |
| gemini-3-pro, gemini-2.5-flash, gemini-2.0-flash | |
| xAI | grok-4, grok-4.1, grok-3 |
| Mistral | mistral-large, codestral, devstral |
| DeepSeek | deepseek-v3.2, deepseek-reasoner |
| Meta | llama-4-maverick, llama-3.3-70b |
| + 7 more | Groq, Cohere, Perplexity, Together, Qwen, OpenRouter, HuggingFace |
Troubleshooting
JavaScript: Module Not Found
If you see Cannot find module 'cencori', verify installation:
Python: ModuleNotFoundError
If you see ModuleNotFoundError: No module named 'cencori':
Authentication Errors
If you receive authentication errors, verify your API key is correct and the environment variable is loaded properly.
Next Steps
- Follow the Quick Start guide to make your first request
- Learn about Security features and threat detection
- Explore the Chat API reference for detailed documentation

