---
title: "Connecting to AI Gateway | Hostman Docs"
description: "Learn how to connect to AI Gateway on Hostman: creating and deleting API keys, and getting connection details for your chosen model and language."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

To connect to AI Gateway, go to the **AI Services → AI Gateway** section.

## Getting Connection Details

You can find the connection details in the **Connection** tab.

1.  Go to **AI Services** → **AI Gateway**.
2.  Open the **Connection** tab.
3.  Select a model and a programming language. The interface will show the input and output token pricing for the selected model. To compare model specifications before choosing, see [Comparing Models](#comparing-models).
4.  Copy the code sample for connecting and the command for installing the OpenAI library.

> [!NOTE]
> You'll need an API key to authenticate. See [Creating an API Key](#creating-an-api-key).

![AI Agents 2026 08 19 13 43](https://content.hostman.com/assets/3a79c2fc-9d14-46ed-9857-9a7b9d3e52fe.png?width=1416&height=1217)

## Comparing Models

The **Models** tab lists all available models along with their type, context window size, maximum response length, and input/output token pricing.

To find a specific model:

1.  Go to **AI Services** → **AI Gateway**.
2.  Open the **Models** tab.
3.  Filter the list by type or provider, or enter a model name in the search field.

To compare models:

1.  Go to **AI Services** → **AI Gateway**.
2.  Open the **Models** tab.
3.  Click **Compare models**.
4.  Select the models you want to compare.

![AI Agents 2026 08 26 08 03](https://content.hostman.com/assets/c503bcff-b9ca-4bba-b3a4-b086a8fae246.png?width=1588&height=868)

## Managing API Keys

### Creating an API Key

AI Gateway uses separate keys that aren't linked to your account level API keys.

> [!NOTE]
> Each API key is billed separately and costs $0.01 per month.

To create a key:

1.  Go to **AI Services** → **AI Gateway**.
2.  Click **Create Key**.
3.  Enter a name for the key and select the validity period.
4.  (Optional) Add a description that will show in the dashboard.
5.  (Optional) Select the project.
6.  Click **Create**.
7.  Copy the generated key and store it locally.

![AI Agents 2026 08 19 13 41](https://content.hostman.com/assets/6bb08c6f-19ac-4f76-bd57-4681edf137aa.png?width=1760&height=852)

### Viewing Key Usage

Each API key has its own dashboard showing incoming and outgoing token counts, token usage, and number of requests. You can filter this data by period and model.

To view key usage:

1.  Go to **AI Services** → **AI Gateway**.
    
2.  Open the **API Keys** tab.
    
3.  Click the key you want to view.
    
4.  Check token usage and number of requests on the **Dashboard** tab.
    
5.  (Optional) Filter the statistics by period or model.
    

### Setting a Token Limit

To set a token usage limit for a key:

1.  Go to **AI Services** → **AI Gateway**.
    
2.  Open the **API Keys** tab.
    
3.  Click the key you want to configure.
    
4.  On the **Management** tab, click **Set limits**.
    
5.  To set **an overall limit**:
    
    -   Enable **Common consumption limit**.
        
    -   Enter the number of tokens (input + output) allowed per day.
        
6.  To set **a limit per model**:
    
    -   Enable **Per-model consumption limit**.
        
    -   Click **Select models**.
        
    -   Choose the models to limit.
        
    -   Enter the number of tokens (input + output) allowed per day for each.
        
    -   (Optional) Click **Add limit** to set another limit.
        
7.  Click **Save**.
    

![New Key 2026 08 26 08 17 (1)](https://content.hostman.com/assets/ef688c83-7610-4288-af5c-44940d47c2f2.png?width=1755&height=869)

### Regenerating an API Key

To regenerate an existing API key:

1.  Go to **AI Services** → **AI Gateway**.
2.  Open the **API Keys** tab.
3.  Click the three dot menu next to the key you want to remove.
4.  Click **Regenerate**.
5.  Confirm the action.

![AI Agents 2026 08 19 13 42](https://content.hostman.com/assets/c2f66c7d-d353-46b3-9b80-12b6aa430bc2.png?width=1415&height=811)

### Deleting an API Key

If you no longer need an API key, you can delete it:

1.  Go to **AI Services** → **AI Gateway**.
2.  Open the **API Keys** tab.
3.  Click the three dot menu next to the key you want to remove.
4.  Click **Delete**.
5.  Confirm the action.

![AI Agents 2026 08 19 13 42](https://content.hostman.com/assets/c2f66c7d-d353-46b3-9b80-12b6aa430bc2.png?width=1415&height=811)
