Custom Providers
How to connect servers that follow the OpenAI, Anthropic, or Gemini API format, such as vLLM, Ollama, or LiteLLM, and set their allowed request types and model prices.
This guide covers only what differs for the Custom type. For adding the Provider, reviewing models, and allowing them in projects, follow Connect model Providers.
Supported request types
Section titled “Supported request types”The supported request types depend on the Base format.
| Base format | Chat | Embeddings | Image generation |
|---|---|---|---|
| OpenAI | Supported | Supported when Embeddings is on | Supported when Image generation is on |
| Anthropic | Supported | Not supported | Not supported |
| Gemini | Supported | Not supported | Not supported |
Connection settings
Section titled “Connection settings”- Base format: choose the API format the server follows. It cannot be changed after creation.
- Base URL: enter the address up to, but not including, the version path (
/v1,/v1beta). AI Gateway appends the path for the format. For example, if an OpenAI-format server lists its models athttp://llm.internal:8000/v1/models, enterhttp://llm.internal:8000. Including/v1makes the model-list request return HTTP 404, and the Provider is not saved. - Credential: leave it blank when the server does not require a key. When you edit a saved Provider, leaving it blank keeps the existing credential.
- Private addresses: for a server on the internal network, turn on Allow private network in the Network section. Otherwise the connection is blocked. See Provider network settings.
Allowed request types
Section titled “Allowed request types”Allowed Request Types are the requests this Provider accepts. The options are Chat Completions and Responses, each with a streaming variant, and with the OpenAI base format also Embeddings and Image generation. A new Provider starts with Chat Completions and Responses selected, and Embeddings and Image generation off.
To turn on embeddings or image generation:
- Under Organization settings → AI resources → Model Providers, open the Provider and go to General. The saved Base format and Allowed Request Types appear.
- Confirm that the base format is OpenAI, then turn on Embeddings or Image generation. The endpoint path field for each type you turn on (Embeddings endpoint path, Image generation endpoint path) appears. Anthropic and Gemini formats do not show these toggles.
- Leave the path blank if the server supports the default. If the base URL ends in
/v1, AI Gateway callsembeddingsorimages/generationsunder it; other standard base URLs use/v1/embeddingsand/v1/images/generations. For a different path, enter one starting with/, such as/embedor/generate. - Click Save changes. Reopen General and confirm that the types you turned on and your paths remain saved.
At least one request type must be on. A Provider that allows only embeddings, or only image generation, can be saved. Turning off Embeddings or Image generation removes only that type’s endpoint path, and keeps the other request types, paths, and network settings.
Embedding requests accept the same input as OpenAI embeddings. Image generation responses pass through the URL or b64_json the server supports, and AI Gateway does not download images from URLs.
Prices
Section titled “Prices”Models of a Custom Provider have no built-in price. They do not inherit OpenAI prices, even when the model name matches. Until you set a price, the cost is recorded as Unavailable and adds $0 to project Budgets.
- Text prices: on the Models page, click Set price for each model and enter input and output rates per million tokens. Embedding models also need an output rate in this form, but embedding output usage is zero, so no output cost accrues.
- Image prices: for image generation models, choose per token, per image, or fixed per image under Image pricing on the Pricing tab. How to enter each mode is in Image prices.
Troubleshooting
Section titled “Troubleshooting”| Symptom | What to check |
|---|---|
| The model list request returns HTTP 404 or 405 when you save | Whether you removed a version path such as /v1 from Base URL |
| An embedding or image generation request fails as an unsupported request | Whether the base format is OpenAI and the type is on in Allowed Request Types |
| An embedding or image generation request fails with 404 from the server | The server’s actual path and the endpoint path value |