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

# Authentication

> How to create and use API tokens to authenticate with the Veogen API.

## Creating an API Token

1. Log in to [veogen.studio](https://veogen.studio)
2. Navigate to **Settings → API Tokens**
3. Click **New Token**, give it a name, and copy the token immediately — it won't be shown again.

## Using Your Token

Pass your token as a Bearer token in the `Authorization` header on every request:

```bash theme={null}
curl https://veogen.studio/api/v1/account \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
```

## Rate Limits

| Limit                      | Value |
| -------------------------- | ----- |
| Requests per minute        | 120   |
| Max image URLs per request | 14    |

If you exceed the rate limit, you'll receive a `429 Too Many Requests` response. The `Retry-After` header indicates how many seconds to wait.

## Error Responses

All errors follow a consistent format:

```json theme={null}
{
  "error": "Insufficient balance.",
  "message": "This generation costs $0.30. Your balance is $0.05.",
  "required": 0.30,
  "balance": 0.05
}
```

### HTTP Status Codes

| Code  | Meaning                                    |
| ----- | ------------------------------------------ |
| `200` | OK                                         |
| `201` | Created (generation submitted)             |
| `401` | Unauthenticated — invalid or missing token |
| `402` | Payment required — insufficient balance    |
| `404` | Not found                                  |
| `422` | Validation error                           |
| `429` | Rate limit exceeded                        |
| `500` | Server error                               |

## Topping Up Your Balance

Top up your USD balance at [veogen.studio/billing](https://veogen.studio/billing). Funds are added instantly and never expire.
