> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redpill.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from OpenRouter

> Switch from OpenRouter for verifiable, TEE-served inference.

## Why migrate

* **Same multi-provider access**: a broad range of models through one endpoint.
* **Attested gateway**: the gateway runs in a TEE and signs a receipt for every response.
* **Drop-in**: works with OpenAI client libraries, like OpenRouter.
* **Verifiable**: cryptographic attestation you can check yourself.
* **Confidential models**: `is_tee` models run on a verified upstream enclave.

## Key difference

| Feature        | OpenRouter            | This platform                                       |
| -------------- | --------------------- | --------------------------------------------------- |
| Multi-provider | Yes                   | Yes (a broad range of models)                       |
| Gateway in TEE | No                    | Yes. The gateway runs in a TEE and signs receipts.  |
| Attestation    | No                    | Confidential (`is_tee`) models attest the upstream. |
| Routed models  | Forwarded to provider | Forwarded to the third-party provider               |

## Migration Steps

<Steps>
  <Step title="Get an API Key">
    Sign up at [redpill.ai](https://www.redpill.ai/register)
  </Step>

  <Step title="Update Endpoint">
    ```python theme={null}
    # 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"
    )
    ```
  </Step>

  <Step title="Update Model Names">
    Some model names may differ - check `/v1/models`
  </Step>
</Steps>

## Model Name Changes

OpenRouter uses provider prefixes:

```python theme={null}
# OpenRouter naming
"openai/gpt-4"
"anthropic/claude-sonnet-4.5"

# RedPill naming (same format!)
"openai/gpt-5"
"anthropic/claude-sonnet-4.5"
```

The platform uses the same provider/model format!

## Code Changes

### Before (OpenRouter)

```python theme={null}
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)

```python theme={null}
from openai import OpenAI

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

response = client.chat.completions.create(
    model="openai/gpt-5",
    messages=[{"role": "user", "content": "Hello"}]
)
```

## New TEE Features

After migration, you can:

### 1. Verify TEE Execution

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

### 2. Use Confidential Models

```python theme={null}
# confidential (is_tee) models
response = client.chat.completions.create(
    model="z-ai/glm-5",
    messages=[...]
)
```

### 3. Get the signed receipt

```python theme={null}
# Cryptographic proof, by receipt id or chat id
receipt = requests.get(
    f"https://api.redpill.ai/v1/aci/receipts/{receipt_id}",
    headers={"Authorization": f"Bearer {api_key}"}
)
```

## Pricing Comparison

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

## Gradual Migration

Run both in parallel:

```python theme={null}
# 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

* Requests served through an attested TEE gateway
* Cryptographic attestation and signed receipts
* Confidential (`is_tee`) models
* Verifiable execution

<Card title="Get Started" icon="rocket" href="/get-started/quickstart">
  Start using the platform now →
</Card>
