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

# Get Current User

> Retrieve the authenticated user's profile, plan, and token balance

## Request

```bash theme={null}
curl https://elumenta.ru/api/v2/user/me \
  -H "Authorization: Bearer nb_YOUR_API_KEY"
```

## Response

<ResponseField name="id" type="integer">
  Internal user ID.
</ResponseField>

<ResponseField name="name" type="string">
  Display name.
</ResponseField>

<ResponseField name="email" type="string | null">
  Email address (null if registered via Telegram only).
</ResponseField>

<ResponseField name="telegram_username" type="string | null">
  Telegram username (null if registered via email/Google).
</ResponseField>

<ResponseField name="avatar_url" type="string | null">
  Profile picture URL.
</ResponseField>

<ResponseField name="plan" type="string">
  Active subscription plan: `free` (Starter) | `basic` | `pro` | `vip` | `elite`
</ResponseField>

<ResponseField name="plan_expires_at" type="string | null">
  ISO 8601 datetime when the current subscription expires. Null for Starter plan.
</ResponseField>

<ResponseField name="token_balance" type="integer">
  Current token balance (subscription tokens + bonus tokens combined).
</ResponseField>

<ResponseField name="token_limit" type="integer">
  Monthly token allowance for your plan.
</ResponseField>

<ResponseField name="rate_limit_hourly" type="integer">
  Max requests per hour. `0` = unlimited (Elite plan).
</ResponseField>

<ResponseField name="rate_limit_daily" type="integer">
  Max requests per day. `0` = unlimited (Elite plan).
</ResponseField>

<ResponseField name="auth_methods" type="object">
  Which authentication methods are connected to this account.
</ResponseField>

## Response Example

```json theme={null}
{
  "id": 1042,
  "name": "Ivan Petrov",
  "email": "ivan@example.com",
  "telegram_username": "ivan_dev",
  "avatar_url": "https://t.me/i/userpic/320/ivan_dev.jpg",
  "plan": "vip",
  "plan_expires_at": "2026-04-08T00:00:00Z",
  "token_balance": 1247,
  "token_limit": 1500,
  "tokens_used_this_period": 253,
  "rate_limit_hourly": 100,
  "rate_limit_daily": 1000,
  "auth_methods": {
    "telegram": true,
    "google": false,
    "email": true
  }
}
```

***

## Get Balance

<api>GET /api/v2/user/balance</api>

Lightweight endpoint for just token balance info.

```bash theme={null}
curl https://elumenta.ru/api/v2/user/balance \
  -H "Authorization: Bearer nb_YOUR_API_KEY"
```

```json theme={null}
{
  "plan": "vip",
  "token_balance": 1247,
  "plan_tokens_remaining": 1247,
  "bonus_tokens": 0,
  "plan_expires_at": "2026-04-08T00:00:00Z",
  "next_refill_at": "2026-04-08T00:00:00Z"
}
```

***

## Update Profile

<api>PATCH /api/v2/user/me</api>

Update your display name or avatar.

```bash theme={null}
curl -X PATCH https://elumenta.ru/api/v2/user/me \
  -H "Authorization: Bearer nb_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ivan P."
  }'
```

### Request Body

<ParamField body="name" type="string">
  New display name.
</ParamField>

<ParamField body="avatar_url" type="string">
  New avatar URL.
</ParamField>

Returns the updated user object.
