Overview
RedPill is fully compatible with the official OpenAI SDK. Just change the base URL and you get access to 218+ models with TEE privacy protection.The easiest way to get started - works with your existing OpenAI code!
Installation
Python Quick Start
Basic Setup
Streaming Responses
Function Calling
Embeddings
Vision (Image Analysis)
TypeScript/JavaScript Quick Start
Basic Setup
Streaming in TypeScript
Function Calling in TypeScript
Using Multiple Models
RedPill gives you access to 218+ models through the same SDK:Environment Variables
Never hardcode API keys. Use environment variables:.env
Python
TypeScript
Error Handling
Async Support
Python Async
TypeScript Async (built-in)
Migration from OpenAI
1
Update Base URL
Add
base_url="https://api.redpill.ai/v1"
to your client initialization2
Update API Key
Replace your OpenAI API key with your RedPill API key
3
Add Provider Prefix
Change
model="gpt-4"
to model="openai/gpt-4o"
4
Test
Run your application - everything else stays the same!
Detailed Migration Guide
Full migration guide with examples →
Supported Features
Feature | Python | TypeScript | Notes |
---|---|---|---|
Chat Completions | ✅ | ✅ | All 218+ models |
Streaming | ✅ | ✅ | Real-time responses |
Function Calling | ✅ | ✅ | Tool use support |
Embeddings | ✅ | ✅ | Vector generation |
Vision | ✅ | ✅ | Image analysis |
Async/Await | ✅ | ✅ | Non-blocking calls |
Popular Models
Model | Best For | Context |
---|---|---|
openai/gpt-4o | General purpose | 128K tokens |
anthropic/claude-3.5-sonnet | Reasoning, analysis | 200K tokens |
deepseek/deepseek-chat | Coding tasks | 64K tokens |
google/gemini-2.0-flash | Fast responses | 1M tokens |
phala/qwen-2.5-7b-instruct | Confidential AI | 32K tokens |
View All Models
Browse complete model list →
Example Projects
CLI Chatbot
Build a command-line AI assistant
Document Q&A
Create a RAG system with embeddings
Code Assistant
Build an AI pair programmer
Data Analyzer
Analyze datasets with AI