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

# Authentication

> Learn how to authenticate with the Verlon AI API

Verlon AI uses API keys to authenticate requests. Your API keys grant access to your gates, usage data, and configuration.

## Getting Your API Key

1. Sign in to your [Dashboard](https://verlon.ai/dashboard)
2. Navigate to **API Keys** in the sidebar
3. Click **Create New Key**
4. Give your key a descriptive name (e.g., "Production", "Development")
5. Copy the key immediately - you won't be able to see it again

> [!WARNING]
>
> **Keep your API keys secure!** Never commit them to version control, share them publicly, or expose them in client-side code.

## Using Your API Key

### With the SDK

Pass your API key when initializing the Verlon client:

```typescript theme={null}
import { Verlon } from '@verlon-ai/sdk';

const verlon = new Verlon({
  apiKey: 'your-api-key-here'
});
```

### With Environment Variables

Store your API key in environment variables for security:

```bash .env theme={null}
VERLON_API_KEY=your_api_key_here
```

Then reference it in your code:

```typescript theme={null}
import { Verlon } from '@verlon-ai/sdk';

const verlon = new Verlon({
  apiKey: process.env.VERLON_API_KEY
});
```

### With Direct API Calls

Include your API key in the `Authorization` header:

```bash theme={null}
curl https://api.verlon.ai/v1/chat/completions \
  -H "Authorization: Bearer your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "gate_id": "your-gate-id",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
```

## Key Management Best Practices

> [accordion] Rotate keys regularly
>
> Create new keys and delete old ones periodically to maintain security. Verlon AI allows multiple active keys per account.

> [accordion] Use different keys for different environments
>
> Create separate keys for development, staging, and production environments. This makes it easier to rotate keys and track usage.

> [accordion] Delete compromised keys immediately
>
> If you suspect a key has been exposed, delete it from your Dashboard immediately and create a new one.

> [accordion] Monitor key usage
>
> Check your Dashboard regularly to review which keys are being used and their associated costs.

## Key Permissions

All Verlon AI API keys have full access to your account:

* Make inference requests through your gates
* Read and modify gates and configuration
* Manage API keys
* Access usage logs and analytics

> [!NOTE]
>
> Since all keys have full permissions, treat them with the same level of security you would treat a password.

## Troubleshooting

### Invalid API Key Error

If you receive an authentication error:

1. Verify your API key is correctly copied (no extra spaces)
2. Check that the key hasn't been deleted in your Dashboard
3. Ensure you're using the correct format: `Bearer your-api-key`

### Rate Limits

API keys are subject to rate limits that exist as abuse prevention —
they scale with your plan tier but are not a pricing axis (see
[Plans](https://docs.verlon.ai/platform/plans.md) for what tiers actually change). If you're
hitting rate limits:

* Implement exponential backoff in your code
* Contact support if your legitimate traffic needs more headroom

## Next Steps

> [card] [Create Your First Gate](https://docs.verlon.ai/dashboard/creating-gates)
>
> Set up a gate to start making requests

> [card] [Make Your First Request](https://docs.verlon.ai/getting-started/quickstart.md)
>
> Follow the quickstart guide to make your first API call


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