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.
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
- Open AI Gateway and select OpenAI, Google Gemini or OpenRouter.
- Enter the provider API Key. The model list loads after the key is available.
- Search for and select a model, or select Custom model name and enter the exact provider model identifier.
- Keep the recommended Route Path or enter a unique path for this configuration.
- Optionally enter a Service Name. When empty, Apiruler generates a provider-based name.
- Expand Advanced Options when model-generation defaults must be overridden.
- Select Create and wait until the new configuration appears in the list.
| Field | Requirement | Description | Example |
|---|---|---|---|
| API Key | Required during creation | Credential used to call the selected provider. | Stored as a secret value |
| Model Name | Required | Provider model identifier selected from the loaded list or entered manually. | gpt-4o-mini |
| Route Path | Optional | Public path clients use for chat requests. | /llm/v1/chat/openai |
| Service Name | Optional | Friendly internal name. A value is generated when left empty. | support-assistant |
| Enabled | Managed from the list | Controls whether the existing configuration is active. | Enabled |
Provider Defaults
| Provider | Default Route path | Model source |
|---|---|---|
| OpenAI | /llm/v1/chat/openai | Models available to the entered OpenAI API Key. |
| Google Gemini | /llm/v1/chat/gemini | Models available to the entered Google Gemini API Key. |
| OpenRouter | /llm/v1/chat/openrouter | Models available to the entered OpenRouter API Key. |
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
| Option | Accepted value | Effect |
|---|---|---|
| Temperature | 0–2 | Controls output randomness. Lower values generally produce more deterministic responses. |
| Max Tokens | Integer greater than or equal to 1 | Limits the maximum number of tokens generated in the response. |
| Top P | 0–1 | Controls nucleus sampling by limiting the probability mass considered during generation. |
| System Prompt | Text | Instruction automatically injected into every request handled by this configuration. |
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
- Locate the configuration by provider, model, Route path or Service name.
- Use Edit to change the model, Route path, Service name or advanced options.
- Leave API Key empty during editing to keep the current key; enter a new value only when rotating it.
- Use Enable or Disable to change availability without deleting the configuration.
- Copy the Route path for client configuration or copy the Service ID for administrative use.
- Delete the configuration only after confirming that no client application depends on its Route path.
Verify an AI Configuration
- Confirm that the provider, model and Route path shown in the list match the intended values.
- Send a POST chat request to the configured Route path using the request format expected by the selected provider integration.
- Confirm that the response is produced by the expected model.
- When a System Prompt is configured, verify that its instruction is reflected without sending it from the client.
- Review Monitoring and Logging for request volume, latency and provider errors.
- Test the Route with the planned client authentication policy before release.
AI Gateway Troubleshooting
| Problem | Likely cause | What 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. |