Atmee.aiDocs
APIAPI referenceAccount

Get the current credential

GET
/v1/api_keys/current

Describes the credential making this call. Readable by the same callers as GET /v1/account/balance.

  • API key (kind: api_key): its name, scopes, the avatar it is restricted to, its session caps and how much of its spend cap the current window used. The secret is never returned. A key has no billing mode: every billed session is charged as it runs, within the key's spend cap, session length and concurrency limits. spendCap.enforced is false when the cap is not applied; limitMicrocredits and remainingMicrocredits are absent when the key has no cap, and windowResetsAt for a lifetime cap (window: total).
  • 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.

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Response Body

The caller.

application/json
  1. response

kind: api_key carries every field but userId; kind: user carries only kind, userId and accountId.

kind*string
Value in"api_key""user"
accountId*string
userId?string

Only for kind user.

id?string

The key's id (kind api_key).

name?string
scopes?array<string>
avatarId?string

The one avatar an avatar-scoped key may use; absent for an account-wide key.

active?boolean
spendCap?
maxSessionSeconds?integer

The key's own cap on a session's length; absent = the plan's.

maxConcurrentSessions?integer

The key's own cap on sessions at once; absent = the plan's.

Example Request
curl -X GET 'https://api.atmanity.us/v1/api_keys/current'
Example Response
{  "kind": "api_key",  "accountId": "string",  "userId": "string",  "id": "string",  "name": "string",  "scopes": [    "string"  ],  "avatarId": "string",  "active": true,  "spendCap": {    "limitMicrocredits": 0,    "window": "string",    "spentMicrocredits": 0,    "remainingMicrocredits": 0,    "windowResetsAt": "2019-08-24T14:15:22Z",    "enforced": true  },  "maxSessionSeconds": 0,  "maxConcurrentSessions": 0}