# The credential making this call

URL: https://www.atmee.ai/docs/v2/api/reference/account/getCurrentApiKey

`GET /v1/api_keys/current`

For an API key (`kind: api_key`): its name, scopes, the avatar it is
restricted to, its billing mode, its own session caps and how much of
its spend cap the current window has used. The secret is never
returned. `spendCap.enforced` is false when the cap is not applied
(an unlimited plan, or billing switched off); `windowResetsAt` is
absent for a cap over the key's whole life (`window: total`), and
`limitMicrocredits` and `remainingMicrocredits` are absent when the
key has no cap (`spentMicrocredits` is still reported).

For a signed-in user (`kind: user`): the user and the account it acts
for; a user has no key, no scopes beyond the avatar ones and no spend
cap.

Readable by the same callers as `GET /v1/account/balance`.

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | The caller. | `CurrentCaller` |
| `401` | Missing or invalid API key -- or a user token that is invalid, anonymous, or of a user who may act for no account (invalid_login) | none |
| `403` | insufficient_scope (a key with neither sessions nor avatars:read) \| account_not_allowed (a user token whose X-Account-Id names an account the user may not act for) | `ApiErrorResponse` |
| `409` | account_ambiguous -- a user token of a user who may act for several accounts, without an `X-Account-Id` header naming one. | `ApiErrorResponse` |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | string (`api_key`, `user`) | yes |  |
| `accountId` | string | yes |  |
| `userId` | string | no | Only for kind user. |
| `id` | string | no | The key's id (kind api_key). |
| `name` | string | no |  |
| `scopes` | array of string | no |  |
| `avatarId` | string | no | The one avatar an avatar-scoped key may use; absent for an account-wide key. |
| `billingMode` | string | no | reserve or metered. |
| `active` | boolean | no |  |
| `spendCap` | `ApiKeySpendCap` | no |  |
| `maxSessionSeconds` | integer | no | The key's own cap on a session's length; absent = the plan's. |
| `maxConcurrentSessions` | integer | no | The key's own cap on sessions at once; absent = the plan's. |
