---
title: "AI Gateway"
---

## Overview

Airia's AI Gateway sits between your applications and the foundation models they call. It provides a single, policy-aware endpoint that adds observability, guardrails, and data loss prevention to every AI request. You can manage multiple gateway configurations to tailor routing, credentials, and protections for each workload.

##Select the Gateway tab from the top navigation to access the AI Gateway workspace.

The page opens with a banner that shows your tenant's universal gateway endpoint. Use the copy button on the banner whenever you need to update client applications.

## Gateway configurations

Each gateway configuration bundles three things:

- the model providers you want to expose and how they authenticate,
- the guardrails and policies that should run before or after each request, and
- the API keys that applications present when they use the gateway.

Every configuration appears as a card on the Gateway page. From a card you can copy the gateway URL, open the configuration modal, manage API keys, or delete the configuration.

### Create or edit a configuration

1. Select **Add Gateway configuration** (or **Configure** on an existing card).
2. The Gateway Configuration modal contains three tabs:
   - **Overview** - Give the configuration a name, optional description, and choose whether it is active. When you edit an existing configuration, this tab also shows Python, JavaScript, and cURL snippets that demonstrate how to point an SDK at the gateway.
   - **AI Providers** - Enable the providers you want to expose (OpenAI, Anthropic, or Ollama). For each provider you can:
     - leave the base URL blank to use the default, or supply a custom endpoint (required for Ollama);
     - decide whether to use the Airia-managed credential or one of your stored credentials; and
     - for Ollama, choose between "No authentication" or selecting a custom credential.
     Create the necessary credentials in **Settings -> Credentials** before selecting the *Use my credential* option.
   - **Guardrails** - After you save a configuration, use this tab to attach existing guardrails or create new ones. Guardrails scoped to "All gateway configurations" apply everywhere; otherwise, select the specific configuration(s) you want to protect. The tab prompts you to complete and save the configuration before guardrails can be managed.
3. Save the configuration. Airia automatically issues an API key and the card becomes available in the list.

### Manage API keys

- Every configuration starts with a standard API key. Choose **Manage API Keys** on a configuration card to create additional keys, disable or enable keys, delete keys, and reveal or copy their values.
- Revealing or copying a key performs a secure fetch of the full token. Use multiple keys to partition environments, rotate credentials, or grant external agents access.

### Using the gateway from your app

1. Replace your direct provider URL with the tenant endpoint shown on the Gateway page. For SDKs, use the `/v1` suffix (for example: `https://<gateway-domain>/v1`).
2. Swap your provider API key for one of the gateway API keys you created.
3. Keep the rest of your request the same. The gateway routes the call to the provider you enabled, applies guardrails, and records observability data.

Example with cURL:

```bash
curl -X POST "https://<gateway-domain>/v1/chat/completions" \
  -H "Authorization: Bearer <AIRIA_GATEWAY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### Maintain configurations

- Toggle **Gateway enabled** on the Overview tab to pause traffic without deleting the configuration.
- Use the actions menu on a configuration card to copy the gateway URL, manage API keys, or delete the configuration. Deleting a configuration immediately invalidates the associated API keys.
