ChartnautDocs

Get the current key

GET/me

Returns the username, plan and key that made the call. It is the quickest check that a key works and has the scopes you expect.

Scope

Heavy call

Long poll

CLI

scripts:read

No

No

chartnaut whoami

Guidance

  • Call it once at start-up, before any real work. A 401 here means the key is wrong, expired or revoked, and every other call would fail the same way.

  • Read token.scopes to decide what your program can offer. A key without runs:write cannot start runs, and finding that out on the first POST /runs is later than it needs to be.

  • token.expires_at tells you when to rotate. null means the key never expires.

  • A 403 plan_limit means the account is on Free. The same key works again within a minute of upgrading, so there is no need to make a new one.

  • The response never changes during a session. Cache it rather than calling it before every request.

Response

200 with:

Field

Type

Description

user

string

Your username

plan

string

free, starter, pro or ultra

token

object

The key that made the call. Fields below

token object

Field

Type

Description

name

string

The key's name, such as CLI on studio-mac

scopes

array of string

Any of scripts:read, scripts:write and runs:write

expires_at

string or null

When the key stops working. null when it never expires

Status codes

Status

Code

Meaning

200

-

The key works. The body describes it

401

unauthorized

No key, or it is wrong, expired or revoked

403

plan_limit

The account is on Free

The other authentication answers are on API reference.