> ## 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. This is a static method -- no client instance needed.

```python theme={null}
from vrin import VRINClient

result = VRINClient.register("user@example.com", "your-password", name="Jane Smith")
```

### Parameters

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

<ParamField body="password" type="string" required>
  Password for the new account.
</ParamField>

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

## Login

Authenticate and receive an API key. Also a static method.

```python theme={null}
result = VRINClient.login("user@example.com", "your-password")
api_key = result["api_key"]

# Now create a client
client = VRINClient(api_key=api_key)
```

### Parameters

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

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

### Returns

```json theme={null}
{
  "api_key": "vrin_live_abc123...",
  "user_id": "user_xyz",
  "email": "user@example.com"
}
```

## API key management

These methods require an authenticated client instance.

### List API keys

```python theme={null}
keys = client.list_api_keys()
```

### Create an API key

```python theme={null}
new_key = client.create_api_key(name="Production Integration")
print(new_key["api_key"])  # Save this -- it won't be shown again
```

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

### Delete an API key

```python theme={null}
client.delete_api_key("key_id_to_delete")
```

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

## Check plan and limits

```python theme={null}
limits = client.get_limits()
print(f"Plan: {limits['plan']}")
print(f"Queries remaining: {limits['queries_remaining']}")
print(f"Inserts remaining: {limits['inserts_remaining']}")
```

Returns:

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

## API key prefixes

| Prefix      | Routing                                            |
| ----------- | -------------------------------------------------- |
| `vrin_`     | Vrin shared infrastructure                         |
| `vrin_ent_` | Customer's own AWS account (enterprise deployment) |

The prefix determines server-side routing. Standard clients and enterprise clients use the same query/insert/upload methods -- the backend handles infrastructure routing transparently.
