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

# Authentication

> How to authenticate API requests.

All API requests require an API key.

## Get your API key

Go to [Settings → API](https://virtualsms.io/settings?tab=api) after creating an account.

## Usage

Pass your key via header (recommended):

```bash theme={null}
curl https://virtualsms.io/api/v1/balance \
  -H "x-api-key: YOUR_API_KEY"
```

Or via query parameter:

```bash theme={null}
curl "https://virtualsms.io/api/v1/balance?api_key=YOUR_API_KEY"
```

<Warning>
  Never expose your API key in client-side code or public repositories.
</Warning>

## Errors

| Status                  | Meaning                                |
| ----------------------- | -------------------------------------- |
| `401 Unauthorized`      | Missing or invalid API key             |
| `403 Forbidden`         | Key valid but insufficient permissions |
| `429 Too Many Requests` | Rate limit exceeded                    |
