Documentation
Account and keys
View .mdOpenAPI

Get the calling token

GEThttps://weights.fyi/run/v1/tokens/selfscope: read
text
GET https://weights.fyi/run/v1/tokens/self
Authorization: Bearer <token>                    scope: read
Available since
Not available yet: built on 2026-10-14 for the Kubernetes product, live with the deploy that carries it.
Answer time
synchronous: the answer is read from your account's records at once.

Tells a program which token it holds: the token's own entry, as GET /v1/tokens would show it, the workspace it is bound to, and the account it belongs to. A token works in one workspace only; no header or parameter moves a call to another. It needs only read, so a token made for one program can learn its own id without the right to see or change the account's other tokens. The token itself is never returned, only its visible prefix. Use it when a program is given a token and must record under which identity it works, or to check that a token still works before starting work that depends on it: a revoked or expired token is refused with 401 before any answer, so a 200 means the token is live at that moment.

The experiment executor of the Kubernetes product is its first user: it holds a customer token to submit the qualification jobs and records their identity from this answer, never from the account table, so the executor's own database role carries no customer identity at all.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer and the token to describe; it must hold read.

The call takes no body.

Return value

200 OK with two fields.

FieldMeaning
tokenThe calling token's entry, with the fields of GET /v1/tokens: id, name, prefix, scopes, created_at, expires_at, expired, revoked_at, last_used_at, last_used_address, daily_cap_usd_micros, rate_limit and issued_by. spend_today is null here. It also has workspace: the id and name of the workspace the token is bound to.
accountAn object with one field, id: the number of the account the token belongs to.

Errors

StatusCodeWhen it happensWhat to do
401unauthorized, invalid_token, token_revoked, token_expiredNo token, or one that does not work (any more).Use a valid token.
403scope_requiredThe token lacks read.Use a token with read.
403account_suspendedThe account is suspended.Talk to us.
404token_not_foundThe call came from a panel session or a sign-in, which hold no token.Call with an API token.

Examples

sh
curl -s https://weights.fyi/run/v1/tokens/self -H "Authorization: Bearer $WEIGHTS_API_KEY"
json
{
  "token": {
    "id": 2,
    "name": "batch runner",
    "prefix": "weights_tcYQQluQ",
    "scopes": ["submit", "read"],
    "created_at": "2026-10-09T08:28:09.778Z",
    "expires_at": null,
    "expired": false,
    "revoked_at": null,
    "last_used_at": "2026-10-14T08:28:09.779Z",
    "last_used_address": null,
    "daily_cap_usd_micros": 25000000,
    "spend_today": null,
    "rate_limit": {"requests_per_second": 1.3125, "burst": 28},
    "issued_by": 12,
    "workspace": {"id": 7, "name": "awow-io"}
  },
  "account": {"id": 7}
}

History

  • 2026-10-14: built for the Kubernetes product, where the experiment executor learns the customer token's identity from the service instead of reading the account table.
  • 2026-11-15 (built, live with the deploy that carries it): token.workspace, the workspace the token is bound to.
  • 2026-11-16 (built, live with the deploy that carries it): issued_by.

See also

GET /v1/tokens, POST /v1/tokens, DELETE /v1/tokens/{token_id}.