---
layout: docs
title: Authentication
section: API Reference
order: 0
---

# Authentication

All API requests require authentication via a Bearer token.

## Getting an API Key

1. Sign in to your AI Republic account
2. Navigate to **Settings** > **API Keys**
3. Click **Generate New Key**
4. Copy and securely store your key

## Using the API Key

Include your API key in the `Authorization` header of every request:

```bash
curl -X GET https://api.airepublic.com/v1/endpoint \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

## Token Expiration

API keys do not expire by default. However, you can set an expiration date when generating a key. Expired keys will return a `401 Unauthorized` response.

## Rate Limiting

API requests are rate limited based on your subscription plan:

| Plan | Requests per minute |
|------|-------------------|
| Free | 60 |
| Pro | 600 |
| Enterprise | Custom |

When rate limited, the API returns a `429 Too Many Requests` response with a `Retry-After` header.
