Skip to main content

Why migrate

  • Same API: a drop-in replacement. Keep your OpenAI SDK and code.
  • Attested gateway: requests are served through a TEE gateway that signs a receipt for every response.
  • More models: not just OpenAI. Also Anthropic, Google, Meta, and confidential (is_tee) models.
  • Verifiable: cryptographic attestation and signed receipts you can check yourself.

Migration Steps

1

Get an API Key

Sign up at redpill.ai and get API key from dashboard
2

Update Base URL

Change base URL from OpenAI to RedPill:
# Before
client = OpenAI(api_key="sk-...")

# After
client = OpenAI(
    api_key="YOUR_REDPILL_KEY",
    base_url="https://api.redpill.ai/v1"  # Add this line
)
3

Test

Make a test request - everything else stays the same!

Code Changes

Python

# Before (OpenAI)
from openai import OpenAI
client = OpenAI(api_key="sk-...")

# After (RedPill)
from openai import OpenAI
client = OpenAI(
    api_key="YOUR_REDPILL_KEY",
    base_url="https://api.redpill.ai/v1"
)

# All other code stays identical!
response = client.chat.completions.create(...)

JavaScript

// Before
const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY
});

// After
const client = new OpenAI({
  apiKey: process.env.API_KEY,
  baseURL: 'https://api.redpill.ai/v1'  // Add this line
});

Go

// Before
config := openai.DefaultConfig(apiKey)

// After
config := openai.DefaultConfig(apiKey)
config.BaseURL = "https://api.redpill.ai/v1"  // Add this line

Environment Variables

Update your .env file:
# Before
OPENAI_API_KEY=sk-...

# After
API_KEY=sk-...
REDPILL_BASE_URL=https://api.redpill.ai/v1

What stays the same

  • All SDK methods
  • Request and response format
  • Streaming
  • Function calling
  • Vision
  • Embeddings
  • Error handling

What’s new

  • Attested gateway: every response carries a signed receipt.
  • More providers: Anthropic, Google, Meta, and more, through one endpoint.
  • Attestation: verify which TEE workload served you.
  • Confidential models: is_tee models run on a verified upstream enclave.

Model Mapping

OpenAI ModelRedPill Equivalent
gpt-4openai/gpt-4 (same)
gpt-5openai/gpt-5 (same)
gpt-3.5-turboopenai/gpt-3.5-turbo (same)
-z-ai/glm-5 (verified provider)
-anthropic/claude-sonnet-4.5
All OpenAI models work identically on the platform, plus 200+ additional models!

Pricing

The platform charges the same price as OpenAI, with TEE protection included at no extra cost.

Gradual Migration

Test with a few requests first:
# Use RedPill for testing
test_client = OpenAI(
    api_key="REDPILL_KEY",
    base_url="https://api.redpill.ai/v1"
)

# Keep OpenAI for production (temporarily)
prod_client = OpenAI(api_key="OPENAI_KEY")

# Switch when confident

Checklist

  • Get an API key
  • Update environment variables
  • Change base URL in code
  • Test with sample requests
  • Monitor usage/costs
  • Full migration

Get Started

Start using the platform now →