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

# Connect LiteLLM

> Set up a LiteLLM proxy so Paladin and Opal's other AI features can send their Claude calls through it.

> [!NOTE]
>
> AI gateways are currently in beta. Contact Opal support to enable them for your organization. If you self-host Opal, you need version `1.1252.0` or later.

## Overview

[LiteLLM](https://docs.litellm.ai/) works as an AI gateway for Opal when it routes Claude models to Anthropic. Opal sends its requests to LiteLLM's Anthropic-compatible `/v1/messages` route, using the same model names it would send to Anthropic.

## Prerequisites

* A LiteLLM proxy that Opal can reach. On Opal cloud, it needs a public HTTPS URL.
* An Anthropic API key for LiteLLM to forward requests with.

## Configure LiteLLM

**1. Route Claude models to Anthropic**

In your LiteLLM config, map Claude model names to Anthropic. A wildcard keeps the names Opal sends unchanged:

```yaml theme={null}
model_list:
  - model_name: "claude-*"
    litellm_params:
      model: "anthropic/claude-*"
      api_key: os.environ/ANTHROPIC_API_KEY
litellm_settings:
  drop_params: false
```

Leave `drop_params` off, so LiteLLM doesn't remove request settings Opal sends.

> [!WARNING]
>
> Don't route Opal's models to `bedrock/` or `vertex_ai/`. Through Bedrock, LiteLLM passes the output schema as a hint instead of enforcing it, so the structured output check fails.

**2. Create a key for Opal**

Create a LiteLLM virtual key for Opal, so you can set its own budget and revoke it on its own. If you list allowed models on the key, include every model in [the gateway requirements](https://docs.opal.dev/docs/paladin/ai-gateway.md#overview).

## Connect it in Opal

Follow [Connect your gateway](https://docs.opal.dev/docs/paladin/ai-gateway.md#connect-your-gateway) with:

| Field | Value |
| - | - |
| **Gateway URL** | Your LiteLLM proxy's root URL, such as `https://litellm.example.com` |
| **Gateway key** | The virtual key you created |
| **Headers** | None needed |

LiteLLM's `/anthropic` pass-through route also works. To use it, add `/anthropic` to the end of the URL.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.