Get the current key
/meReturns 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 |
|---|---|---|---|
| No | No |
|
Guidance
Call it once at start-up, before any real work. A
401here means the key is wrong, expired or revoked, and every other call would fail the same way.Read
token.scopesto decide what your program can offer. A key withoutruns:writecannot start runs, and finding that out on the firstPOST /runsis later than it needs to be.token.expires_attells you when to rotate.nullmeans the key never expires.A
403 plan_limitmeans 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 |
|---|---|---|
| string | Your username |
| string |
|
| object | The key that made the call. Fields below |
token object
Field | Type | Description |
|---|---|---|
| string | The key's name, such as CLI on studio-mac |
| array of string | Any of |
| string or null | When the key stops working. |
Status codes
Status | Code | Meaning |
|---|---|---|
| - | The key works. The body describes it |
|
| No key, or it is wrong, expired or revoked |
|
| The account is on Free |
The other authentication answers are on API reference.
