List API tokens
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
| Name | Where | Required | Meaning |
|---|---|---|---|
Authorization | header | yes | Bearer and a token that holds the manage scope. |
include_expired | query | no | true 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.
| Field | Meaning |
|---|---|
tokens | The account's tokens, newest first, each an object as below. |
day | Always UTC: the day over which every spend_today is counted. |
Each token:
| Field | Meaning |
|---|---|
id | The token's number in your account. DELETE /v1/tokens/{token_id} takes it. |
name | The name you gave the token when you made it, or token if you gave none. |
prefix | The first characters of the token, weights_ and eight more, enough to recognise it and never enough to use it. |
scopes | What the token may do, a list of submit, read and manage, in that order. |
created_at | When the token was made. |
expires_at | When the token stops working, or null for a token without an expiry. |
expired | true once expires_at has passed; such a token is listed only with include_expired=true. |
revoked_at | When the token was revoked, or null while it has not been. |
last_used_at | When the token was last used for any call, or null if it never was. |
last_used_address | The address the last call came from, as the service saw it, or null when no address was recorded. |
daily_cap_usd_micros | The token's spend cap per UTC day in micro-dollars, or null for no cap. |
spend_today | For a live token with a cap, today's spend as below; otherwise null. |
rate_limit | The 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_by | The 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:
| Field | Meaning |
|---|---|
day | UTC. |
since | The start of today, 00:00 UTC. |
resets_at | The start of tomorrow, 00:00 UTC, when the count starts again. |
spent_usd_micros | The 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_waiting | How many pages of those jobs are still waiting or being worked on. |
waiting_usd_micros | Those pages at each job's price per page. |
training_reserved_usd_micros | What 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_micros | spent_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
| Status | Code | When it happens | What to do |
|---|---|---|---|
401 | unauthorized, invalid_token, token_revoked, token_expired | No token, or one that does not work (any more). | Use a valid token. |
403 | scope_required | The token lacks manage; required and granted say what it needs and what it has. | Use a token with manage, or the panel. |
403 | account_suspended | The account is suspended. | Talk to us. |
Examples
curl -s https://weights.fyi/run/v1/tokens -H "Authorization: Bearer $WEIGHTS_API_KEY"{
"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 inspent_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_byon each token.