AI

AI Gateway

Configure supported AI providers and models.

AI Gateway Capabilities

AI Gateway creates a managed API entry for a supported model provider. The configuration combines provider authentication, model selection, a public Route path and optional generation parameters.

Use separate configurations when applications require different providers, models, access paths or generation behavior.

  • Supported providers: OpenAI, Google Gemini and OpenRouter.
  • Provider model lists can be loaded after a valid API Key is entered.
  • A custom model name can be used when the required model is not shown in the list.
  • Existing configurations can be edited, enabled, disabled or deleted.

Before You Create an AI Configuration

  • Obtain an API Key from the selected provider and confirm that it can access the intended model.
  • Decide the public Route path that client applications will call.
  • Decide whether the default model behavior is sufficient or Temperature, Top P, Max Tokens and System Prompt must be controlled centrally.
  • Plan an authentication or rate-limiting policy for the new Route before sharing it with client applications.
Provider credentials

API Keys are sensitive. Enter them only in the AI Gateway form and store the source value in an approved secret-management system.

Create an AI Gateway Configuration

Navigation pathMain menuAI GatewaySelect ProviderConfigure
  1. Open AI Gateway and select OpenAI, Google Gemini or OpenRouter.
  2. Enter the provider API Key. The model list loads after the key is available.
  3. Search for and select a model, or select Custom model name and enter the exact provider model identifier.
  4. Keep the recommended Route Path or enter a unique path for this configuration.
  5. Optionally enter a Service Name. When empty, Apiruler generates a provider-based name.
  6. Expand Advanced Options when model-generation defaults must be overridden.
  7. Select Create and wait until the new configuration appears in the list.
FieldRequirementDescriptionExample
API KeyRequired during creationCredential used to call the selected provider.Stored as a secret value
Model NameRequiredProvider model identifier selected from the loaded list or entered manually.gpt-4o-mini
Route PathOptionalPublic path clients use for chat requests./llm/v1/chat/openai
Service NameOptionalFriendly internal name. A value is generated when left empty.support-assistant
EnabledManaged from the listControls whether the existing configuration is active.Enabled

Provider Defaults

ProviderDefault Route pathModel source
OpenAI/llm/v1/chat/openaiModels available to the entered OpenAI API Key.
Google Gemini/llm/v1/chat/geminiModels available to the entered Google Gemini API Key.
OpenRouter/llm/v1/chat/openrouterModels available to the entered OpenRouter API Key.
Generated Route behavior

A new AI configuration creates a POST Route for HTTP and HTTPS traffic. The matched Route path is removed before the request is sent to the provider endpoint.

Advanced Model Options

OptionAccepted valueEffect
Temperature0–2Controls output randomness. Lower values generally produce more deterministic responses.
Max TokensInteger greater than or equal to 1Limits the maximum number of tokens generated in the response.
Top P0–1Controls nucleus sampling by limiting the probability mass considered during generation.
System PromptTextInstruction automatically injected into every request handled by this configuration.
Use one sampling control deliberately

Change Temperature and Top P only when the application behavior requires it. Test response consistency and quality before using the configuration in production.

Manage an Existing AI Configuration

  1. Locate the configuration by provider, model, Route path or Service name.
  2. Use Edit to change the model, Route path, Service name or advanced options.
  3. Leave API Key empty during editing to keep the current key; enter a new value only when rotating it.
  4. Use Enable or Disable to change availability without deleting the configuration.
  5. Copy the Route path for client configuration or copy the Service ID for administrative use.
  6. Delete the configuration only after confirming that no client application depends on its Route path.

Verify an AI Configuration

  1. Confirm that the provider, model and Route path shown in the list match the intended values.
  2. Send a POST chat request to the configured Route path using the request format expected by the selected provider integration.
  3. Confirm that the response is produced by the expected model.
  4. When a System Prompt is configured, verify that its instruction is reflected without sending it from the client.
  5. Review Monitoring and Logging for request volume, latency and provider errors.
  6. Test the Route with the planned client authentication policy before release.

AI Gateway Troubleshooting

ProblemLikely causeWhat to do
The model list does not load.The API Key is empty, invalid or cannot list models.Re-enter the provider key and confirm its permissions and network access.
The required model is missing.The model is unavailable to the account or omitted from the returned list.Confirm provider access, then use Custom Model Name only with an exact supported identifier.
The configuration cannot be created.API Key or Model Name is missing.Complete both required fields and retry.
Client requests return an authorization error.The provider key is invalid or the client-facing Route policy rejects the request.Separate provider authentication from client authentication and verify both.
Responses are truncated.Max Tokens is lower than the output requires.Increase Max Tokens within the provider and application limits.
Responses are inconsistent.Sampling values are too permissive for the use case.Lower Temperature or review Top P, then compare repeat test requests.

Need a hand?

If you get stuck during installation or configuration, our team is ready to help.