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

# Connect providers

> Register the OpenAI, Anthropic, and Azure upstreams the gateway forwards to

A provider is an upstream LLM service the gateway forwards requests to. You connect providers once
on the Config page, and the gateway routes traffic to them from there.

## Add a provider

Go to **Config** and add a provider under **Providers**:

* **Name**: a label you choose, such as `openai`. Routing rules refer to providers by this name.
* **Base URL**: the provider's API root, such as `https://api.openai.com`.
* **Format**: the wire protocol and auth the provider expects. One of `openai`, `anthropic`, or `azure_openai`.
* **API key env var**: the name of the environment variable that holds the provider's secret, such as `OPENAI_API_KEY`.
* **API version** (Azure only): appended to each request as `?api-version=...`.

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-docs/0DNdDuuycN4Yl8SH/images/gateway/provider_config.png?fit=max&auto=format&n=0DNdDuuycN4Yl8SH&q=85&s=4fb3a9fcca324112faf472df9efc89c5" alt="Connecting a provider on the Config page" data-path="images/gateway/provider_config.png" />

<Note>
  A provider's secret never lives in the portal. You reference the **name** of
  an environment variable, and the secret itself is set on the gateway host at
  deploy time. Coordinate with us to add or rotate one.
</Note>

## Supported formats

| Format         | Speaks                 | Auth header             | Use for                                                    |
| -------------- | ---------------------- | ----------------------- | ---------------------------------------------------------- |
| `openai`       | OpenAI Responses API   | `Authorization: Bearer` | OpenAI and OpenAI-compatible providers                     |
| `anthropic`    | Anthropic Messages API | `x-api-key`             | Anthropic                                                  |
| `azure_openai` | OpenAI Responses API   | `Authorization: Bearer` | Azure OpenAI / Foundry (OpenAI models); set an API version |

`azure_openai` uses the same wire protocol as `openai`, with an API version appended to every
request.

## Default routing

With no routing rules, requests pass through by format: an OpenAI-style request (to `/v1/responses`)
goes to your `openai` provider, and an Anthropic-style request (to `/v1/messages`) goes to your
`anthropic` provider. To send traffic anywhere else, see [Route requests](/gateway/route-requests).

## Azure and Microsoft Foundry

Point the **Base URL** at the resource path the model lives under, including its prefix (for example
`.../openai` for OpenAI models or `.../anthropic` for Anthropic models). Use the `azure_openai`
format with an API version for OpenAI models, or the `anthropic` format for Anthropic models hosted
on Foundry.
