Connect model Providers
The flow every model Provider follows to be added, have its models reviewed, and become available to projects, and which request types each Provider type supports.
This guide covers the flow that every Provider type follows. When you save a Provider, AI Gateway reads its model list. Once a project policy allows a model, users call it as <Provider name>/<model ID>.
Settings that differ by type are in each type’s guide:
| Provider type | Use it for | Guide |
|---|---|---|
| OpenAI | Connecting with an OpenAI API key | OpenAI |
| Anthropic | Connecting with an Anthropic API key, or letting users send requests on their own Claude subscription | Anthropic |
| Gemini | Connecting with a Google API key | Gemini |
| AWS Bedrock, AWS Bedrock Mantle | Models in your AWS account’s Bedrock | AWS Bedrock |
| Custom | Servers that follow the OpenAI, Anthropic, or Gemini API format, such as vLLM, Ollama, or LiteLLM | Custom Providers |
The OpenAI Codex type is hidden in a default installation. It appears only when the installation engineer turns on CODEX_ENABLED.
Supported request types
Section titled “Supported request types”Every type accepts chat requests. Embeddings (POST /v1/embeddings) and image generation (POST /v1/images/generations) are supported by some types only.
| Provider type | Embeddings | Image generation |
|---|---|---|
| OpenAI | Supported | Supported |
| Anthropic | Not supported | Not supported |
| Gemini | Not supported | Two models only |
| AWS Bedrock | Some models | Some models |
| AWS Bedrock Mantle | Not supported | Not supported |
| Custom (OpenAI format) | Supported when an administrator turns it on | Supported when an administrator turns it on |
| Custom (Anthropic or Gemini format) | Not supported | Not supported |
| OpenAI Codex | Not supported | Not supported |
The supported models and settings are in each type’s guide. A request for a model on a Provider that does not support the request type fails without being sent to the Provider. If you use routing rules, the final target Provider must support the request type.
Before you start
Section titled “Before you start”- Permission: only organization administrators (
org-admin) can add Providers. - Credentials: have the API key or credentials for the Provider you are connecting. Each type’s guide lists what it needs.
- Network: the AI Gateway server must reach the Provider’s address over HTTPS. If you use a private address, a private CA, or a proxy, read Provider network settings first.
Open the admin console from the Organization settings tab at the top of the screen. Paths such as AI resources → Model Providers below are groups and items in the admin console’s left menu.
1. Add the Provider
Section titled “1. Add the Provider”- In AI resources → Model Providers, click Add provider.
- Enter a Name. It becomes the prefix of every model ID users call, and may contain only lowercase letters, digits, dots, underscores, and hyphens. For example, a Provider saved as
openai-prodis called asopenai-prod/gpt-5.6. You can add several Providers of the same type under different names, for example one per account or purpose. - Description is optional. Noting the account owner or purpose makes Providers easier to tell apart later.
- Choose the Provider type. Base URL is filled with the type’s official address.
- Enter the credentials as described in the type’s guide. Secret values are stored write-only and never shown again.
- If needed, set the Network section and Project visibility. By default a Provider connects to public internet addresses and is visible to every project. See Provider network settings and Provider project visibility.
- Click Test connection. On success, it shows how many models will be brought in. The test is optional, but it checks the key and address before you save.
- Click Save provider.
When you save, AI Gateway reads the Provider’s model list to check the credentials. If they are rejected or the address cannot be reached, the form shows why and the Provider is not created.
2. Review the models
Section titled “2. Review the models”Open the new Provider from the Provider list and go to its Models page. Every model ID that the Provider’s model-list API returned is registered there.
- The list can include models that are not used for chat, such as embedding or speech models. Being registered does not mean a model can be called with every request type. Check Supported request types.
- When the Provider releases new models, click Check for model updates. It shows new models and models that the Provider no longer lists, and applies only the changes you select. Checking alone changes nothing.
3. Check prices
Section titled “3. Check prices”AI Gateway calculates the cost of each request from the model’s price. On the Models page, click View pricing on a model to see the price that applies. Where the price comes from, and whether administrators can set or change it, depend on the Provider type. See Model pricing and costs.
4. Allow the models in projects
Section titled “4. Allow the models in projects”Saving a Provider does not let anyone call its models yet. A project policy must allow them. Follow Allow models in projects and select this Provider’s models.
Then tell users which model IDs to call (<Provider name>/<model ID>). The user-side setup is in Set up AI agents, and embedding and image generation examples are in OpenAI SDK.
Request size limits
Section titled “Request size limits”Embedding and image generation requests have AI Gateway size limits on top of any Provider limits. Compressed requests are checked both as received and after decompression.
| Request | Request body | Response body |
|---|---|---|
| Embeddings (OpenAI, Custom) | Up to 100 MiB. Above 10 MiB, only model, permission, Budget, and size checks run and the request is forwarded to the Provider as is | Up to 8 MiB |
| Embeddings (AWS Bedrock) | Up to 10 MiB. The body converted to AWS format has the same limit | Up to 8 MiB |
| Image generation | Up to 10 MiB | Up to 64 MiB after decompression |
A request body over the limit fails with 413. An image generation response over the limit, or one that cannot be processed as valid JSON, fails with 502. An embedding response over 8 MiB cannot be returned. Provider token, batch, and image count limits and quotas apply separately.
- On 413, shorten the input or prompt, or split the batch.
- For a large embedding response, reduce
dimensionswithin what the model supports, or use base64 output. - For a large image generation response, reduce the image count, size, or quality, or use URL output when the model supports it.
Image generation takes a JSON request and returns one response. stream:true, partial_images, multipart requests, and the image edit and variation APIs are not supported.
Manage Providers
Section titled “Manage Providers”- Replace a key: enter the new key in Credential on the Provider’s General page and save. Leaving it blank keeps the current key. The new key is not checked when you save, so a wrong key makes requests to this Provider fail from that point on. After saving, click Check for model updates on the Models page to confirm that the new key can read the model list. Changing AWS Bedrock authentication is covered in AWS Bedrock.
- Disable: Disable in the Provider list rejects new requests to this Provider’s models and removes them from project model lists. Settings and models are kept, so Enable restores them.
- Delete: deletes the Provider and its registered models. To pause a Provider, disable it instead.
Troubleshooting
Section titled “Troubleshooting”| Message | What to check |
|---|---|
| The provider rejected the credential | Whether the key is correct and has not expired or been revoked |
| A host name could not be resolved | The spelling of Base URL and the AI Gateway server’s DNS and proxy settings |
| A server certificate could not be verified | If you use a private CA, register the CA certificate in the Network section |
| The Provider address is on a private network, so the connection was blocked | Turn on Allow private network |
| The model list request returned HTTP 404 or 405 | For a Custom Provider, remove a version path such as /v1 from Base URL |