---
title: "Introspect the calling key (whoami)"
method: GET
path: "/v1/me"
tags: ["Identity"]
---

# Introspect the calling key (whoami)

`GET /v1/me`

## Request

- Base URL: `https://api.pyai.com`
- URL: `https://api.pyai.com/v1/me`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Return the identity the gateway resolved for your key: `key_id`, `org_id`, `project_id`, environment (`test`/`live`), `status`, the granted `scopes`, and the rate-limit/credit posture. Any active key may call it (no special scope), so it is the fastest way to self-diagnose a `403 insufficient_scope` (check `scopes`), a `402 credit_exhausted`/`key_budget_exceeded` (check `credit` and `key_budget_cents`), or an `org_suspended` (`org_status`).

## Response `200`

The calling key's identity and limits.

- Identity: The identity the gateway resolved for the calling key, plus its enforced limits and credit posture. Returned by `GET /v1/me`.
  - `object` string
  - `key_id` string: The calling key's id.
  - `org_id` string
  - `project_id` string
  - `env` 'test' | 'live': Key environment. `test` keys run in the sandbox tier (daily unit cap, no credit gate).
  - `status` 'active' | 'revoked': Key status.
  - `org_status` 'active' | 'suspended': Owning org status; `suspended` explains a 403 `org_suspended`.
  - `scopes` string[]: Granted scopes. A missing scope here explains a 403 `insufficient_scope`.
  - `expires_at` integer, nullable: Key expiry (Unix ms); null = non-expiring.
  - `plan` string: Billing plan id.
  - `limits` object: Per-key gateway limits (what the edge actually enforces).
    - `rps` integer: Requests per second.
    - `burst` integer: Token-bucket burst.
    - `concurrency` integer: Max concurrent realtime sessions.
    - `monthly_units` integer, nullable: Hard monthly metered-unit cap (hard-capped plans); null = metered/no hard cap.
    - `daily_unit_cap` integer, nullable: Sandbox/publishable per-day unit ceiling; present for `test` keys.
  - `credit` object: Prepaid-credit posture. Explains a 402 `credit_exhausted`.
    - `gated` boolean: True when this key is subject to the org prepaid-credit gate (live keys on an org with no active paid subscription).
    - `available_cents` integer: Available prepaid credit in USD cents (ledger balance plus this month's free grant when gated).
  - `key_budget_cents` integer, nullable: Per-key monthly spend cap (USD cents); null = no per-key budget. Hitting it is a 402 `key_budget_exceeded`.

## Other responses

- `401`: Missing or invalid API key (`code: unauthorized`)

---

[API](https://skmtc.dev/pyai/apis/pyai-api.md) · [All operations](https://skmtc.dev/pyai/apis/pyai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pyai/apis/pyai-api/revisions/271a1539185b?raw)
