Documentation
Account and keys
View .mdOpenAPI

List API tokens

GEThttps://weights.fyi/run/v1/tokensscope: manage
text
GET https://weights.fyi/run/v1/tokens[?include_expired=true]
Authorization: Bearer <token>                    scope: manage
Available since
2026-10-08, when the service went live on weights.fyi/run. Implemented 2026-10-09: training counted in spend_today.
Answer time
synchronous: the answer is read from your account's records at once and does not wait for the model.

Lists every API token of your account, newest first, with its scopes, limits and last use, never the token itself: only its visible prefix, so the list cannot leak a secret. Use it to audit, to find a token to revoke, or to see how close a capped token is to its limit today. A revoked token stays listed, with its last use, and never works again. A token whose expiry has passed never works again either and is left out, unless you send include_expired=true. It needs manage, even for a token's own entry; the panel, /app, shows the same list and can change a cap.

rate_limit counts only calls that need submit and is the same for every token unless we set another; the default is 8 calls a second with bursts of 64 (Errors and limits). For a token with a cap, spend_today counts the UTC day: today's jobs' cost so far plus their waiting pages at the quote, because queued work will be paid; it is null for a token without a cap, revoked or expired.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer and a token that holds the manage scope.
include_expiredquerynotrue or 1 also lists the tokens whose expiry has passed. Without it they are left out.

Return value

200 OK with an object of two fields.

FieldMeaning
tokensThe account's tokens, newest first, each an object as below.
dayAlways UTC: the day over which every spend_today is counted.

Each token:

FieldMeaning
idThe token's number in your account. DELETE /v1/tokens/{token_id} takes it.
nameThe name you gave the token when you made it, or token if you gave none.
prefixThe first characters of the token, weights_ and eight more, enough to recognise it and never enough to use it.
scopesWhat the token may do, a list of submit, read and manage, in that order.
created_atWhen the token was made.
expires_atWhen the token stops working, or null for a token without an expiry.
expiredtrue once expires_at has passed; such a token is listed only with include_expired=true.
revoked_atWhen the token was revoked, or null while it has not been.
last_used_atWhen the token was last used for any call, or null if it never was.
last_used_addressThe address the last call came from, as the service saw it, or null when no address was recorded.
daily_cap_usd_microsThe token's spend cap per UTC day in micro-dollars, or null for no cap.
spend_todayFor a live token with a cap, today's spend as below; otherwise null.
rate_limitThe token's request rate: requests_per_second, how many calls that send work it may make per second on average, and burst, how many it may make at once before the rate applies.
issued_byThe person who issued the token: the person behind the credential that made it, or null for a token no person issued. A token's scope=mine (GET /v1/compute/plans, GET /v1/jobs) counts the work of every token its person issued.

The spend_today object:

FieldMeaning
dayUTC.
sinceThe start of today, 00:00 UTC.
resets_atThe start of tomorrow, 00:00 UTC, when the count starts again.
spent_usd_microsThe charges posted today for the token's page jobs, plus what its training jobs were charged on this UTC day, counted on the day it was seen, whenever the job started.
pages_waitingHow many pages of those jobs are still waiting or being worked on.
waiting_usd_microsThose pages at each job's price per page.
training_reserved_usd_microsWhat is left of the estimates of the token's open training jobs (merged on 2026-10-09, live from the deploy that carries it); it counts every day until the job ends.
committed_usd_microsspent_usd_micros plus waiting_usd_micros (and, since the merge of 2026-10-09, training_reserved_usd_micros): the figure the cap is checked against.

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 manage; required and granted say what it needs and what it has.Use a token with manage, or the panel.
403account_suspendedThe account is suspended.Talk to us.

Examples

sh
curl -s https://weights.fyi/run/v1/tokens -H "Authorization: Bearer $WEIGHTS_API_KEY"
json
{
  "tokens": [
    {
      "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-09T08:28:09.779Z",
      "last_used_address": null,
      "daily_cap_usd_micros": 25000000,
      "spend_today": {
        "day": "UTC",
        "since": "2026-10-09T00:00:00.000Z",
        "resets_at": "2026-10-10T00:00:00.000Z",
        "spent_usd_micros": 0,
        "pages_waiting": 0,
        "waiting_usd_micros": 0,
        "training_reserved_usd_micros": 0,
        "committed_usd_micros": 0,
        "not_metered_yet": []
      },
      "rate_limit": {"requests_per_second": 1.3125, "burst": 28},
      "issued_by": 12
    },
    {
      "id": 1,
      "name": "test",
      "prefix": "weights_I9AYkq1e",
      "scopes": ["submit", "read", "manage"],
      "created_at": "2026-10-09T08:28:09.773Z",
      "expires_at": null,
      "expired": false,
      "revoked_at": null,
      "last_used_at": "2026-10-09T08:28:09.780Z",
      "last_used_address": null,
      "daily_cap_usd_micros": null,
      "spend_today": null,
      "rate_limit": {"requests_per_second": 1.3125, "burst": 28},
      "issued_by": 12
    }
  ],
  "day": "UTC"
}

History

  • 2026-10-08: live with scopes, expiry, the daily cap, the request rate and last use.
  • 2026-10-09 (merged): training_reserved_usd_micros; training's spend in spent_usd_micros.
  • 2026-11-15 (built, live with the deploy that carries it): expired tokens are left out unless include_expired=true.
  • 2026-11-16 (built, live with the deploy that carries it): issued_by on each token.

See also

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