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

# Custom models

> Register your own model deployments and API keys, then call them like any other Opper model.

You aren't limited to Opper's hosted models. Register your own provider deployment, for example a private Azure OpenAI deployment, with its API key. It then appears in the catalog alongside built-in models and gets the same routing, governance, and tracing.

## Register a custom model

The quickest way is in the dashboard. Open **Settings → Models → Custom** in [platform.opper.ai](https://platform.opper.ai) and add a model:

| Field           | What to enter                                                  |
| --------------- | -------------------------------------------------------------- |
| **Name**        | A label, e.g. "My Custom Model".                               |
| **Identifier**  | How you'll call it, e.g. `example/my-gpt4`.                    |
| **Type**        | The provider type (Azure, OpenAI-compatible, and so on).       |
| **Credentials** | The provider's API key, token, or service-account JSON.        |
| **API URL**     | Your endpoint, e.g. `https://my-deployment.openai.azure.com/`. |

Save it, then call the model by its identifier like any other.

<Note>
  Custom models are scoped to your project. The identifier prefix (e.g., `example/`) is the namespace.
</Note>

### Register from the API or CLI

If you'd rather automate it:

<Tabs>
  <Tab title="cURL">
    ```shell theme={null}
    curl -X POST https://api.opper.ai/v2/custom-models \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer ${OPPER_API_KEY}" \
      -d '{
        "name": "example/my-gpt4",
        "provider": "azure",
        "model_id": "gpt4-production",
        "api_key": "my-api-key-here",
        "params": {
          "api_base": "https://my-gpt4-deployment.openai.azure.com/",
          "api_version": "2024-06-01"
        }
      }'
    ```
  </Tab>

  <Tab title="CLI">
    ```shell theme={null}
    opper models create example/my-gpt4 azure/gpt4-production my-api-key-here \
      '{"api_base": "https://my-gpt4-deployment.openai.azure.com/", "api_version": "2024-06-01"}'
    ```
  </Tab>
</Tabs>

## Model aliases

An alias maps a stable name to an **ordered list of models** — a primary plus fallbacks. The gateway tries them in order, so the alias doubles as a [backup chain](/capabilities/models#aliases-and-backup-chains): if the first model is down or rate-limited, the call continues to the next.

The easiest way is the platform under **Settings → Models**. To automate it:

```shell theme={null}
curl -X POST https://api.opper.ai/v2/model-aliases \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${OPPER_API_KEY}" \
  -d '{
    "name": "production/main",
    "fallback_models": [
      "anthropic/claude-sonnet-4-6",
      "openai/gpt-5.5",
      "mistral/mistral-large"
    ]
  }'
```

Use `production/main` in your code, then reorder or repoint the chain anytime — no integration changes, no downtime. Custom models you've registered can go into the chain too.

## What's next

<CardGroup cols={2}>
  <Card title="Models" icon="brain" href="https://opper.ai/models">
    The full catalog of built-in models.
  </Card>

  <Card title="AI Gateway" icon="signs-post" href="/overview/gateway">
    How routing, model selection, and BYOK fit together.
  </Card>
</CardGroup>
