Configure AI Gateway

Set up AI Gateway by connecting your LLM providers, creating an LLM endpoint for your applications to call, and issuing access keys that control who can use it.

Configuration order

AI Gateway configuration builds on four objects. Create them in the following order:

  1. Provider: A connection to an LLM service, such as Anthropic or Azure OpenAI, along with the credentials AI Gateway uses to authenticate.
  2. LLM endpoint: The URL your applications call. Each LLM endpoint contains its own routes, access keys, and policies.
  3. Route: A pairing of one provider and one model, with its own timeout limit.
  4. Access key: The credential an application presents to AI Gateway. Each access key grants access to one or more routes.

Policies are optional. Create a policy when you need to cap the request rate or token usage of the access keys assigned to it, or restrict access by IP address.

The first time you open AI Gateway, the gateway guides you through this sequence. You can also complete each step individually using the procedures in this guide.

Add a provider

A provider stores the credentials AI Gateway uses to authenticate with an LLM service. Providers are stored in a project, and you can reuse the same provider connection in genies.

AI Gateway supports the following LLM providers: Anthropic, OpenAI Compatible, Azure OpenAI, AWS Bedrock, and Google Gemini. The fields you configure depend on the provider you select.

Complete the following steps to add a provider:

1

Go to AI Gateway > Providers.

2

Click Add provider.

Add providerAdd provider

3

Enter a descriptive name in the Connection name field.

Create providerCreate provider

4

Use the Location drop-down menu to select the project or folder where you plan to store this provider.

5

Use the Connection type drop-down menu to select Cloud or an on-prem group. Select an on-prem group when the provider's endpoint isn't reachable from the public internet.

ON-PREM GROUPS

If you select an on-prem group in Connection type, the API URL or Endpoint URL must be reachable from the on-prem agent's network. Private DNS names and IP addresses are allowed.

6

Use the LLM Provider drop-down menu to select the provider this connection uses. The remaining fields depend on the provider you select:

Click Create to complete the setup.

PROVIDER UNREACHABLE

AI Gateway returns Error 503 and the message Could not reach provider. The service may be temporarily down or overloaded. Please try again shortly. when it can't reach the provider. Your entries are preserved. Click Create again to retry.

The provider displays in the Providers list with a Connected status and the date it was added.

Edit a provider

Complete the following steps to edit a provider:

1

Go to AI Gateway > Providers.

2

Click the actions menu for the provider you plan to edit, then click Edit. This opens the Edit provider page.

3

Update the fields for the provider.

4

Click Save.

Delete a provider

Complete the following steps to delete a provider:

1

Go to AI Gateway > Providers.

2

Click the actions menu for the provider you plan to delete, then click Delete.

3

Review the impact summary. The Delete provider dialog lists the number of access keys affected and confirms that deleting the provider removes it from all routes that use it, that keys invoking those routes may return errors, and that access is revoked for all users with keys.

4

Select I understand that this action cannot be undone.

5

Click Delete.

Create an LLM endpoint

An LLM endpoint is the URL your applications send requests to. Each LLM endpoint contains its own routes, access keys, and policies, which lets you separate configuration by team, application, or environment.

PREREQUISITES

You must add at least one provider before you create an LLM endpoint.

Complete the following steps to create an LLM endpoint:

1

Go to AI Gateway > Endpoints.

2

Click + Create LLM endpoint.

Create LLM endpointCreate LLM endpoint

3

Enter a name in the LLM endpoint name field.

Create LLM endpointCreate LLM endpoint

4

Use the Location drop-down menu to select the project or folder where you plan to store this LLM endpoint.

5

Click Create. The Add route modal displays.

6

Enter a name in the Route name field.

Add routeAdd route

AI Gateway generates the Route ID from the route name.

7

Use the Provider drop-down menu to select the provider to use for this route. Manage providers in the Providers tab.

8

Use the Model drop-down menu to select which model from the selected provider to use for this route.

9

Optional. Expand Limits and configure the following field:

1

Enter the maximum time allowed for a single attempt before it fails in the Attempt timeout (in seconds) field. This value must be less than or equal to the request timeout.

10

Click Create.

The route displays in the Routes list with its route ID, provider, models, and creation date.

LLM endpoint details

The details panel on an LLM endpoint page displays the following:

  • LLM endpoint name: The name of the LLM endpoint.
  • LLM endpoint URL: The base URL your applications call. Click Copy URL to copy it.
  • Location: The project or folder that stores the LLM endpoint.
  • Created: The date and time the LLM endpoint was created.

Create a route

A route pairs one provider with one model and defines the timeout behavior for requests that use it.

PREREQUISITES

You must add at least one provider before you create a route.

Complete the following steps to create a route:

1

Go to your LLM endpoint and click the Routes tab.

2

Click + Add route.

Add routeAdd route

3

Enter a name in the Route name field.

Add routeAdd route

AI Gateway generates the Route ID from the route name.

4

Use the Provider drop-down menu to select the provider to use for this route. Manage providers in the Providers tab.

5

Use the Model drop-down menu to select which model from the selected provider to use for this route.

6

Optional. Expand Limits and configure the following field:

1

Enter the maximum time allowed for a single attempt before it fails in the Attempt timeout (in seconds) field. This value must be less than or equal to the request timeout.

7

Click Create.

The route displays in the Routes list with its route ID, provider, models, and creation date.

Edit a route

Complete the following steps to edit a route:

1

Go to your LLM endpoint and click the Routes tab.

2

Click the actions menu for the route you plan to edit, then click Edit.

Edit routeEdit route

3

Update the route fields, then click Save.

Delete a route

KEYS STOP FUNCTIONING

Any access key that uses a deleted route no longer functions and must be recreated.

Complete the following steps to delete a route:

1

Go to your LLM endpoint and click the Routes tab.

2

Click the actions menu for the route you plan to delete, then click Delete.

Delete routeDelete route

3

Click Delete to confirm.

Create an access key

An access key is the credential an application presents to AI Gateway. Each key grants access to one or more routes, which determine the provider and model the key can use.

PREREQUISITES

You must create at least one route before you create an access key.

Complete the following steps to create an access key:

1

Go to your LLM endpoint and click the Keys tab.

2

Click Add key.

Add keyAdd key

3

Enter a descriptive name in the Name field.

Create keyCreate key

4

Use the Route(s) drop-down menu to select the routes this key can use, then click OK. Click Select all to select every route in the LLM endpoint. Manage routes in the Routes tab.

5

Optional. Use the Policy drop-down menu to select a policy for this key. Click Create policy to create a policy without leaving the dialog, or manage policies in the Policies tab. Refer to Create a policy for the field descriptions.

SHARED USAGE

All users who share an access key contribute to the same rate and token limits. Issue separate access keys for teams or applications that need independent limits.

6

Click Create.

7

Copy the generated key and store it in a safe place. Click Copy, then click Close.

THE KEY IS DISPLAYED ONCE

You can't view the generated key again after you close the dialog. Refresh the key to generate a new value if you lose it.

The access key displays in the Keys list with its routes, policy, creation date, and a masked key value. You can filter the list by route and by policy.

Edit an access key

Complete the following steps to edit an access key:

1

Go to your LLM endpoint and click the Keys tab.

2

Click the actions menu for the key you plan to edit, then click Edit.

Edit keyEdit key

3

Update the Name, Route(s), or Policy fields, then click Save.

Refresh an access key

Refresh an access key to rotate its value. Refreshing generates a new token and revokes access for all current users of the key.

CLIENTS MUST BE UPDATED

Applications that use the previous token lose access when you refresh a key. You must update each client with the refreshed token to regain access.

Complete the following steps to refresh an access key:

1

Go to your LLM endpoint and click the Keys tab.

2

Click the actions menu for the key you plan to refresh, then click Refresh.

Refresh keyRefresh key

3

Click Refresh token.

4

Copy the refreshed key and store it in a safe place. Click Copy, then click Close. You can't view the refreshed key again after you close the dialog.

Delete an access key

ACCESS IS REVOKED IMMEDIATELY

Deleting an access key revokes access for all current users of that key. You can't undo this action.

Complete the following steps to delete an access key:

1

Go to your LLM endpoint and click the Keys tab.

2

Click the actions menu for the key you plan to delete, then click Delete.

3

Click Delete to confirm.

Delete keyDelete key

Create a policy

A policy defines the rate limits, token limits, and IP access restrictions that apply to the access keys assigned to it. Policies are scoped to an LLM endpoint and you can reuse them across the access keys in that LLM endpoint.

Complete the following steps to create a policy:

1

Go to your LLM endpoint and click the Policies tab.

2

Click Add policy.

Add policyAdd policy

3

Enter a name in the Name field.

Create new policyCreate new policy

4

Optional. Expand Rate limit to specify the throttle limit per key, then configure the following fields:

1

Use the Time interval drop-down menu to select the interval the limit applies to.

2

Enter the number of requests allowed per key in the selected time interval in the Number of requests field.

5

Optional. Expand Token limit to define each key's token usage quota, then configure the following fields:

1

Use the Time interval drop-down menu to select the interval the limit applies to.

2

Enter the number of tokens allowed per key in the selected time interval in the Number of tokens field.

6

Optional. Expand IP access control to restrict access by IP address, then configure the following fields:

1

Optional. Enter one or more IP addresses in the Allowed IPs field to allow requests only from those addresses. Separate multiple IP addresses with commas, or define a netmask, for example 106.226.96.0/20.

2

Optional. Enter one or more IP addresses in the Blocked IPs field to block requests from those addresses. Separate multiple IP addresses with commas, or define a netmask, for example 106.226.96.0/20.

7

Click Create.

Validation messages

AI Gateway returns the following validation messages:

FieldMessageCondition
Connection name, NameName cannot exceed 100 characters.The name is longer than 100 characters.
API URLPlease enter a valid URL.The value isn't a valid URL.
Attempt timeout (in seconds)Value must be between 1 and 360 seconds.The value is outside the supported range.

Last updated: