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

# API Keys

> Creating, managing, and revoking API keys from the dashboard.

## Overview

API keys are used to authenticate requests to the ModelStack API. Each key starts with `sk_` and can be given a descriptive name for easy identification.

## Creating an API Key

1. Navigate to **Dashboard → API Keys**
2. Click **Create API Key**
3. Enter a descriptive name (e.g., "Production Server", "Development", "CI/CD Pipeline")
4. Click **Create**
5. **Copy the key immediately** — it won't be shown again

<Warning>
  API keys are only displayed once at creation time. Store them securely. If you lose a key, you'll need to create a new one.
</Warning>

## Managing API Keys

Your API keys dashboard shows:

* **Key name** — The descriptive name you assigned
* **Key prefix** — First few characters of the key (e.g., `abc...`)
* **Created date** — When the key was created
* **Last used** — Timestamp of the most recent API call with this key

## Revoking an API Key

To revoke (delete) an API key:

1. Navigate to **Dashboard → API Keys**
2. Find the key you want to revoke
3. Click the **delete** button
4. Confirm the revocation

<Warning>
  Revoking a key is immediate and irreversible. Any application using that key will immediately receive `401 Unauthorized` errors.
</Warning>

## Key Limits by Plan

| Plan | Maximum API Keys |
| - | - |
| Starter | 5 |
| Pro | 20 |
| Max | Unlimited |

If you need more API keys, [upgrade your plan](https://modelstack.cc/pricing).

## Best Practices

* **Use descriptive names** — Name keys after their use case (e.g., "Backend Production", "Testing")
* **One key per environment** — Use separate keys for development, staging, and production
* **Rotate regularly** — Periodically create new keys and revoke old ones
* **Revoke compromised keys immediately** — If a key is exposed, revoke it from your dashboard right away


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.