> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Router API keys

> Create and manage AI Router API keys with optional cost, token, and rate limits for production, staging, and development environments.

<Tip>
  For organization-wide access, [Admin Keys](/docs/administer/api-keys) are also available and can be managed from the **Organizations** section.
</Tip>

## What are API Keys

API Keys are secure tokens **required to authenticate and make requests to the AI Router**. You can provision multiple API keys for different environments (production, staging, development), purposes, or team members, providing granular control and auditing of who accesses the AI Router.

With API Keys, you can:

* Authenticate requests to the **AI Router**
* Control access by environment or team
* Set optional budget limits to prevent unexpected costs
* Track usage and consumption per key

## Creating an API Key

To create your API keys:

1. Navigate to the **API Keys** page in the **AI Router**
2. Choose **Create API Key**, the following modal opens:

<div style={{ width: "70%", margin: "0 auto" }}>
  <Frame caption="Configure a name, optional spending limits, and expiration when creating an API key.">
    <img src="https://mintcdn.com/orqai/TakbnHEz73lP-GwI/images/create-api-key-ai-router.png?fit=max&auto=format&n=TakbnHEz73lP-GwI&q=85&s=c964d16498086b5ffca34f676554af86" alt="Configure a name, optional spending limits, and expiration when creating an API key." width="687" height="797" data-path="images/create-api-key-ai-router.png" />
  </Frame>
</div>

The following fields are configurable:

* A unique **Name** for the key
* An optional **Expiration Date** for the key

### Setting Limits

API Keys support optional spending limits to control costs and prevent unexpected usage:

* **Cost Limit** (in USD): Caps the total spend for requests made with this key.
* **Token Limit**: Caps the total number of tokens consumed.
* **Requests/Min**: Caps the number of requests within a rolling 60-second window.
* **Reset Limit Period**: Defines when the Cost and Token counters reset, allowing recurring budget allocations for different teams or projects. Does not apply to Requests/Min, which always uses a 60-second window.

<Warning>
  When any configured limit is reached, further requests using this key are rejected with a `429 Too Many Requests` error.
</Warning>

## Managing API Keys

API Keys can be created, viewed, and managed from the dedicated AI Router page to ensure secure access.

<Frame caption="Manage your API keys here">
  <img src="https://mintcdn.com/orqai/XV7lYWD_-4drZGS_/images/view-api-key-ai-router.png?fit=max&auto=format&n=XV7lYWD_-4drZGS_&q=85&s=f40b9e7d93c60dfb1aef5c31c457bf85" alt="Manage your API keys here" width="751" height="171" data-path="images/view-api-key-ai-router.png" />
</Frame>

* To disable an API Key, use the **Toggle**, it can be re-enabled at any time.
* To delete an API Key, use the `...` button, and choose **Delete** to revoke an API Key.
* To see details of the consumption for your **API Key**, use the `...` button, and choose **Overview**. Here you can see the current usage and limits for the selected key.

<Info>
  **Caution**: Revoking an API key is permanent and cannot be undone. Make sure the key is not being used by any applications before revoking it.
</Info>
