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

# Authentication

> Register, login, and manage API keys

## Register

Create a new Vrin account.

```
POST /api/auth/signup
```

<ParamField body="email" type="string" required>
  Email address for the new account.
</ParamField>

<ParamField body="password" type="string" required>
  Password.
</ParamField>

<ParamField body="name" type="string">
  Display name.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "user_id": "user_xyz",
    "api_key": "vrin_live_abc123...",
    "message": "Account created"
  }
  ```
</ResponseExample>

## Login

Authenticate and receive an API key.

```
POST /api/auth/login
```

<ParamField body="email" type="string" required>
  Account email.
</ParamField>

<ParamField body="password" type="string" required>
  Account password.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "api_key": "vrin_live_abc123...",
    "user_id": "user_xyz",
    "email": "user@example.com"
  }
  ```
</ResponseExample>

## List API keys

List all API keys for the authenticated user.

```
GET /api/auth/api-keys
```

<ParamField header="Authorization" type="string" required>
  Bearer token.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "api_keys": [
      {
        "key_id": "key_123",
        "name": "Production",
        "prefix": "vrin_abc...",
        "created_at": "2025-12-01T00:00:00Z"
      }
    ]
  }
  ```
</ResponseExample>

## Create API key

```
POST /api/auth/create-api-key
```

<ParamField header="Authorization" type="string" required>
  Bearer token.
</ParamField>

<ParamField body="name" type="string">
  Human-readable name for the key.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "api_key": "vrin_new_key...",
    "key_id": "key_456",
    "name": "Production"
  }
  ```
</ResponseExample>

<Warning>
  The full API key is only shown once at creation time. Store it securely.
</Warning>

## Delete API key

```
POST /api/auth/delete-api-key
```

<ParamField header="Authorization" type="string" required>
  Bearer token.
</ParamField>

<ParamField body="key_id" type="string" required>
  The ID of the key to delete (not the key value).
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "API key deleted"
  }
  ```
</ResponseExample>

## Get user limits

Check the authenticated user's plan and usage limits.

```
GET /api/user/limits
```

<ParamField header="Authorization" type="string" required>
  Bearer token.
</ParamField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "plan": "free",
    "queries_remaining": 100,
    "inserts_remaining": 50,
    "allowed_models": ["gpt-4o-mini"],
    "max_file_size_mb": 10
  }
  ```
</ResponseExample>
