> ## 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 OpenAI or OpenRouter

> Point an existing OpenAI-compatible integration at RedPill: a new base URL, a new key, and provider-prefixed model ids.

RedPill is OpenAI-compatible, so a migration is a base URL and a key. Model ids carry a provider
prefix, the same format OpenRouter uses.

<CodeGroup>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["REDPILL_AI_API_KEY"],
      base_url="https://api.redpill.ai/v1",
  )
  response = client.chat.completions.create(
      model="openai/gpt-5",
      messages=[{"role": "user", "content": "Hello"}],
  )
  ```

  ```javascript JavaScript theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: process.env.REDPILL_AI_API_KEY,
    baseURL: "https://api.redpill.ai/v1",
  });
  ```
</CodeGroup>

|               | From OpenAI                                                     | From OpenRouter                                                                            |
| ------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Base URL      | `https://api.openai.com/v1` becomes `https://api.redpill.ai/v1` | `https://openrouter.ai/api/v1` becomes `https://api.redpill.ai/v1`                         |
| Model id      | `gpt-5` becomes `openai/gpt-5`                                  | Same `provider/model` format; confirm each id in [`GET /v1/models`](/api-reference/models) |
| Extra headers | None                                                            | Drop `HTTP-Referer` and `X-Title`                                                          |

Streaming, function calling, vision, and error shapes are unchanged. What RedPill adds: every
response carries an `x-receipt-id` you can [verify](/guides/verify-a-response), and confidential
(`is_tee`) models run on a verified upstream enclave. See [Models](/get-started/models).
