Skip to main content

Overview

The platform is fully compatible with the official OpenAI SDK. Just change the base URL and you get access to a broad range of 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

The platform gives you access to a broad range of 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 initialization
2

Update API Key

Replace your OpenAI API key with your platform API key
3

Add Provider Prefix

Change model="gpt-4" to model="openai/gpt-5"
4

Test

Run your application - everything else stays the same!

Detailed Migration Guide

Full migration guide with examples →

Supported Features

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

Next Steps

Function Calling Guide

Learn advanced function calling

Streaming Guide

Implement streaming responses

Vision Guide

Work with images and vision models

Error Handling

Handle errors gracefully