> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/ai-gateway/create-an-ai-gateway.md).

# Create an AI Gateway

## Procedures

{% stepper %}
{% step %}

#### Sign In

Go to [**zenConsole**](https://console.zenlayer.com/) and log in with your account. On the left menu bar, go to **Products** > **GPU & AI** > **AI Gateway**, and click **Create AI Gateway**.

<div align="left" data-with-frame="true"><figure><img src="https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-d6633ae32d59732e09c9d1086bf95b90ee976960%2Fimage.png?alt=media" alt="" width="491"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Configure Token Quota

A token represents a unit of text processed by the model. Token quota defines the maximum number of tokens, including **all token types**, such as input tokens, output tokens, cached tokens, and any other tokens consumed during request processing.

The token quota is unlimited by default. Uncheck **Unlimited quota** if you want to restrict the maximum number of tokens this API key can consume.

**Usage Cap Example**

For example, if you set the token quota to **1,000,000 tokens**:

* The API key can consume up to 1,000,000 tokens in total
* Once the quota is reached, the API key will be automatically suspended
* No further token consumption or API requests will be allowed unless the quota is updated

<div align="left"><figure><img src="https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-8e563967ca233c500b9458ecd816945cd91cd9a6%2Fimage.png?alt=media" alt="" width="479"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### *<mark style="color:green;">(Optional)</mark>* Configure API Key Expiration

You can set an expiration time for temporary or project-based access.

Available values: `7 days`, `30 days`, `60 days`, `90 days`, `Long-lived`, and `Custom`.

Leave blank for unlimited validity.
{% endstep %}

{% step %}

#### Set AI Gateway Name

Give an identifier to your AI gateway instance.
{% endstep %}

{% step %}

#### More Settings

You can add your AI gateway instance into a specified resource group. In a resource group, specific members can be granted defined permissions for resources.

See [Create a Resource Group](/welcome/platform/team-management/create-a-resource-group.md) for more details.
{% endstep %}

{% step %}

#### Complete Creation

Review and confirm the AI Gateway terms, then click ***Create*** to create an AI Gateway.
{% endstep %}
{% endstepper %}

## Result

Once created, you will receive an **API Access Key**, which is used for all subsequent API calls. See [**API docs**](https://docs.console.zenlayer.com/api-reference/compute/aig) to view all related API interfaces.

Copy this access key and store it securely.

<div align="left" data-with-frame="true"><figure><img src="https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-8a6f78f7a5a5d5af61a667835f456ab7b4709e02%2Fimage.png?alt=media" alt="" width="369"><figcaption></figcaption></figure></div>

## What to Do Next

Click the AI Gateway name to view the details page of logs, data analysis and basic information.

You can also perform the follow operations in **Actions** if you need:

### Manage Token Quota

Uncheck **Unlimited quota** to enter a quota limit.

<div align="left" data-with-frame="true"><figure><img src="https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-3ba54b808f152d6f723737d704efc28fd6596f1d%2Fimage.png?alt=media" alt="" width="370"><figcaption></figcaption></figure></div>

### Manage Expiration

Select desired API key expiration duration.

<div align="left" data-with-frame="true"><figure><img src="https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-4d7bc8b05895b72e03896c4015906db95c884f3a%2Fimage.png?alt=media" alt="" width="359"><figcaption></figcaption></figure></div>

### Duplicate AI Gateway

Click ***Duplicate AI Gateway*** to create an AI Gateway with the same configuration.

### Delete

Click ***Delete*** if you don't need the AI gateway any more.
