# Get the current key and account

> Returns the key used for the request, the account behind it, whether the account may use the API, the credit balance, the limits and how the request was seen.

Source: https://diko.app/en/api-docs/reference/get-me

Account · `GET /me`

- **Base URL:** https://api.diko.app/api/v1
- **Required scope:** Any valid key
- **Rate-limit policy:** `read`, `account`, `me`
- **Authentication:** `Authorization: Bearer dk_live_...`

It works for any valid key, even when the plan does not include the API, so it is the right call for diagnosing access problems. The account e-mail is always masked, and the credit balance is returned only when the key has the `library:write` scope (it is null otherwise). It has its own limit of one request per second (a burst of five is allowed).

## Response

### 200

The key, the account and its limits.

- `RateLimit`: The most restrictive policy that applied: `"name";r=<requests left>;t=<seconds>`, where `t` is the number of seconds until one more request is allowed (0 when the quota is full). Absent when no rate limiter ran for the request.
- `RateLimit-Policy`: The rate-limit policies that applied to the request, one `"name";q=<burst>;w=<seconds>` item per policy, for example `"read";q=10;w=2, "account";q=20;w=2`: `q` is the burst quota and `w` the seconds in which an empty quota refills. Sent on every authenticated response; absent when no rate limiter ran for the request, for example when it was rejected before the key was checked.
- `Request-Id`: ID of this request (`req_` prefix), the same as `request_id` in an error body. It is also sent as `X-Request-ID`. Quote it when you contact support.
- `X-Client-Request-Id`: Your own `X-Client-Request-Id` request header, echoed back. It is sent only when the value you sent has 1-128 characters from A-Z a-z 0-9 . _ : -.
- `X-RateLimit-Limit`: Burst quota of the most restrictive policy (`q` in `RateLimit-Policy`). Absent when no rate limiter ran.
- `X-RateLimit-Remaining`: Requests left in the most restrictive policy (`r` in `RateLimit`). Absent when no rate limiter ran.
- `X-RateLimit-Reset`: Seconds until one more request is allowed in the most restrictive policy (`t` in `RateLimit`; 0 when the quota is full). It is a number of seconds, not a timestamp. Absent when no rate limiter ran.

Content type: `application/json`

- `object` (string, required): Always `me`.
- `api_key` (object, required): The key used for this request.
  - `id` (string, required, 26–26 characters, pattern: ^key_[0-9A-Za-z]{22}$): Public key ID (`key_` prefix).
  - `object` (string, required): Always `api_key`.
  - `name` (string, required): Name given to the key.
  - `description` (string, required): Optional description; an empty string when not set.
  - `hint` (string, required): Non-secret hint: prefix plus the first and last four characters of the random part.
  - `scopes` (array<string>, required): Scopes granted to the key. Allowed values: `meetings:read`, `library:read`, `library:write`.
  - `status` (string, required): Lifecycle status. `expired` is derived from `expires_at`. Allowed values: `active`, `disabled`, `revoked`, `expired`.
  - `allowed_cidrs` (array<string>, required): IP allowlist in CIDR notation. An empty list allows any address.
  - `created_at` (string, required, ≤ 24 characters, format: date-time): When the key was created.
  - `expires_at` (string, required, ≤ 24 characters, format: date-time): When the key stops working. Every key expires; the maximum is 365 days.
  - `last_used_at` (string | null, required, ≤ 24 characters, format: date-time): Last use, written at most every 5 minutes. Null if never used.
  - `last_used_ip` (string | null, required): IP of the last use. Stored only when the address could be determined reliably.
  - `first_used_at` (string | null, required, ≤ 24 characters, format: date-time): First use. Null if never used.
  - `disabled_at` (string | null, required, ≤ 24 characters, format: date-time): When the key was disabled, if it is disabled.
  - `revoked_at` (string | null, required, ≤ 24 characters, format: date-time): When the key was revoked, if it is revoked.
  - `revoked_reason` (string | null, required): Why the key was revoked: `user` (you revoked it), `rotated` (a rotation grace period ended), `admin` (a team administrator revoked it), `owner` (the team owner revoked it), `user_disabled` (the account was disabled), `leaked` (a leak was detected), `dormant` (unused for a year), `revoke_all` (the revoke-all action). Allowed values: `user`, `rotated`, `admin`, `owner`, `user_disabled`, `leaked`, `dormant`, `revoke_all`.
  - `rotated_from` (string | null, required, 26–26 characters, pattern: ^key_[0-9A-Za-z]{22}$): ID of the key this key replaced through rotation.
  - `grace_until` (string | null, required, ≤ 24 characters, format: date-time): Until when the previous key keeps working after a rotation.
- `user` (object, required): The owning account.
  - `id` (string, required, 26–26 characters, pattern: ^usr_[0-9A-Za-z]{22}$): Public user ID (`usr_` prefix).
  - `object` (string, required): Always `user`.
  - `email` (string, required): Account e-mail address, masked (for example `j***@example.com`). The full address is never returned to an API key.
  - `display_name` (string | null, required): Display name, if set.
- `access` (object, required): Whether the account may use the API.
  - `allowed` (boolean, required): True when API requests are allowed. `GET /me` works even when this is false.
  - `reason` (string, required): Why access is or is not granted. Allowed values: `subscription`, `team`, `owner`, `exempt`, `paywall_off`, `subscription_required`, `plan_required`.
  - `plan` (string | null, required): Plan family of the account, or null. Allowed values: `asmeninis`, `pro`, `verslas`.
- `credits` (object | null, required): Credit balance. Null unless the key has the `library:write` scope, the only scope that spends credits.
  - `scope` (string | null, required): Whose balance this is: the personal one or the shared team pool. Null when it could not be read. Allowed values: `user`, `organization`.
  - `available` (string | null, required): Available credits as a decimal string, for example `"123.5000"`. Null when it could not be read.
  - `as_of` (string | null, required, ≤ 24 characters, format: date-time): When the balance was read. It is cached for 30 seconds per user. Null when it could not be read.
- `limits` (object, required): Limits that apply.
  - `rate` (object, required): Rate-limit policies.
    - `read` (object, required): Policy `read`, per API key.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
    - `write` (object, required): Policy `write`, per API key.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
    - `imports` (object, required): Policy `imports`, per API key.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
    - `account` (object, required): Policy `account`, shared by all keys and members of the billing tenant: the paying team on a team plan, otherwise the user.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
    - `me` (object, required): Policy `me`, per API key; applies to `GET /me` only.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
    - `export` (object, required): Policy `export`, shared by all keys and members of the billing tenant (the paying team on a team plan, otherwise the user); applies to transcripts with `format=text`, `srt` or `vtt`.
      - `burst` (integer, required, 0–2147483647, format: int32): Bucket capacity: how many requests may be sent at once.
      - `per_second` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per second, when the policy refills per second.
      - `per_minute` (integer | null, optional, 0–2147483647, format: int32): Refill rate in tokens per minute, when the policy refills per minute.
  - `max_active_imports` (integer, required, 0–2147483647, format: int32): Most imports that may be active at once for the user.
  - `max_daily_imports` (integer, required, 0–2147483647, format: int32): Most imports the user may create per day.
- `request` (object, required): How this request was seen.
  - `ip` (string | null, required): Client IP as seen by Diko, or null when it cannot be determined reliably.
  - `ip_trusted` (boolean, required): Whether the IP comes from a trusted proxy chain. IP allowlists need a trusted IP.

```json
{
  "object": "me",
  "api_key": {
    "id": "key_4Vf9771zpS8JcQdtUcR0u8",
    "object": "api_key",
    "name": "CRM sync",
    "description": "",
    "hint": "dk_live_Ab12…9xYz",
    "scopes": [
      "meetings:read",
      "library:write"
    ],
    "status": "active",
    "allowed_cidrs": [],
    "created_at": "2026-10-11T09:00:00.000Z",
    "expires_at": "2027-01-09T09:00:00.000Z",
    "last_used_at": null,
    "last_used_ip": null,
    "first_used_at": null,
    "disabled_at": null,
    "revoked_at": null,
    "revoked_reason": null,
    "rotated_from": null,
    "grace_until": null
  },
  "user": {
    "id": "usr_4iAD1dYhdAEJIkMN5GPczR",
    "object": "user",
    "email": "j***@example.com",
    "display_name": "Jonas"
  },
  "access": {
    "allowed": true,
    "reason": "subscription",
    "plan": "pro"
  },
  "credits": {
    "scope": "user",
    "available": "123.5000",
    "as_of": "2026-10-11T09:30:00.000Z"
  },
  "limits": {
    "rate": {
      "read": {
        "burst": 10,
        "per_second": 5
      },
      "write": {
        "burst": 5,
        "per_second": 1
      },
      "imports": {
        "burst": 5,
        "per_minute": 30
      },
      "account": {
        "burst": 20,
        "per_second": 10
      },
      "me": {
        "burst": 5,
        "per_second": 1
      },
      "export": {
        "burst": 10,
        "per_second": 1
      }
    },
    "max_active_imports": 10,
    "max_daily_imports": 500
  },
  "request": {
    "ip": null,
    "ip_trusted": false
  }
}
```

## Examples

**cURL**

```bash
curl "https://api.diko.app/api/v1/me" \
  -H "Authorization: Bearer $DIKO_API_KEY"
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://api.diko.app/api/v1/me",
    headers={"Authorization": f"Bearer {os.environ['DIKO_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

**TypeScript**

```typescript
const response = await fetch("https://api.diko.app/api/v1/me", {
  headers: {
    Authorization: `Bearer ${process.env.DIKO_API_KEY}`,
  },
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
```

## Errors

This endpoint can return these errors. Every code is described in the error catalog.

| HTTP | Code | Meaning | Retry? |
|---|---|---|---|
| 401 | [`missing_api_key`](https://diko.app/en/api-docs/errors.md#missing_api_key) | The request has no `Authorization` header. | no |
| 401 | [`invalid_api_key`](https://diko.app/en/api-docs/errors.md#invalid_api_key) | The header is unusable (a scheme other than `Bearer`, an empty key or more than one `Authorization` header) or the key is unknown or malformed (wrong structure or checksum). The response is identical in all these cases. | no |
| 401 | [`api_key_expired`](https://diko.app/en/api-docs/errors.md#api_key_expired) | The key has expired. | no |
| 401 | [`api_key_revoked`](https://diko.app/en/api-docs/errors.md#api_key_revoked) | The key was revoked: manually, after a rotation grace period ended, because of a leak or because the account was disabled. | no |
| 401 | [`api_key_disabled`](https://diko.app/en/api-docs/errors.md#api_key_disabled) | The key is temporarily disabled. | no |
| 403 | [`ip_not_allowed`](https://diko.app/en/api-docs/errors.md#ip_not_allowed) | The key has an IP allowlist and the request IP is not on it, or it cannot be determined reliably. | no |
| 403 | [`account_disabled`](https://diko.app/en/api-docs/errors.md#account_disabled) | The account is disabled. | no |
| 403 | [`email_not_verified`](https://diko.app/en/api-docs/errors.md#email_not_verified) | The account e-mail address is not verified. | no |
| 403 | [`api_access_suspended`](https://diko.app/en/api-docs/errors.md#api_access_suspended) | A Diko administrator suspended API access for this account. | no |
| 429 | [`rate_limit_exceeded`](https://diko.app/en/api-docs/errors.md#rate_limit_exceeded) | A rate-limit policy was exceeded. `error.details.policy` names it. | yes, after Retry-After |
| 500 | [`internal_error`](https://diko.app/en/api-docs/errors.md#internal_error) | An internal server error. | conditionally |
| 503 | [`service_unavailable`](https://diko.app/en/api-docs/errors.md#service_unavailable) | The service is temporarily busy, for example because of database load. | yes, after Retry-After |
