Why Migrate?

Same Multi-Provider - 218+ models ✅ TEE Protection - Hardware-enforced privacy ✅ OpenAI Compatible - Better SDK support ✅ Verifiable - Cryptographic attestation ✅ Confidential Models - Phala TEE models

Key Difference

FeatureOpenRouterRedPill
Multi-provider✅ Yes✅ Yes (218+ models)
TEE Protection❌ NoFull gateway in TEE
Attestation❌ No✅ Cryptographic proof
Privacy❌ None✅ Hardware-enforced

Migration Steps

1

Get RedPill API Key

Sign up at redpill.ai
2

Update Endpoint

# Before (OpenRouter)
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="YOUR_OPENROUTER_KEY"
)

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

Update Model Names

Some model names may differ - check /v1/models

Model Name Changes

OpenRouter uses different naming:
# OpenRouter naming
"openai/gpt-4"
"anthropic/claude-3.5-sonnet"

# RedPill naming (same!)
"gpt-4"  # or "openai/gpt-4"
"anthropic/claude-3.5-sonnet"
RedPill supports both formats!

Code Changes

Before (OpenRouter)

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=os.environ.get("OPENROUTER_API_KEY"),
)

response = client.chat.completions.create(
    extra_headers={
        "HTTP-Referer": "https://yourapp.com",
        "X-Title": "Your App"
    },
    model="openai/gpt-4",
    messages=[{"role": "user", "content": "Hello"}]
)

After (RedPill)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.redpill.ai/v1",
    api_key=os.environ.get("REDPILL_API_KEY"),
)

response = client.chat.completions.create(
    model="openai/gpt-4o",  # Simplified!
    messages=[{"role": "user", "content": "Hello"}]
)

New TEE Features

After migration, you can:

1. Verify TEE Execution

# Get attestation
attestation = requests.get(
    "https://api.redpill.ai/v1/attestation/report",
    headers={"Authorization": f"Bearer {api_key}"}
)

2. Use Confidential Models

# Phala TEE models
response = client.chat.completions.create(
    model="phala/deepseek-chat-v3-0324",
    messages=[...]
)

3. Get Signatures

# Cryptographic proof
signature = requests.get(
    f"https://api.redpill.ai/v1/signature/{request_id}",
    params={"model": "phala/qwen-2.5-7b-instruct"}
)

Pricing Comparison

Both use pay-as-you-go, but RedPill adds TEE protection at no extra cost.

Gradual Migration

Run both in parallel:
# Test with RedPill
redpill = OpenAI(
    base_url="https://api.redpill.ai/v1",
    api_key="REDPILL_KEY"
)

# Keep OpenRouter (temporarily)
openrouter = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="OPENROUTER_KEY"
)

# Compare responses
redpill_resp = redpill.chat.completions.create(...)
openrouter_resp = openrouter.chat.completions.create(...)

Benefits After Migration

✅ Hardware-protected requests ✅ Cryptographic attestation ✅ Confidential AI models ✅ Better privacy compliance ✅ Verifiable execution

Get Started

Start using RedPill now →