Revoke an API key
Revokes the key. The operations the edge answers itself refuse it at once; every other request refuses it within 10 seconds (the edge keeps a key's record at most 10 seconds after reading it from its primary database, and never reads keys from a replica). The edge also pushes the revocation to nodes, so open streams authenticated by it close within 60 seconds. Routines published with it pause their triggers. Returns the revoked key; it stays listed for audit. Changes made with `PATCH /v1/keys/{key_id}` take effect within the same 10 seconds.
DELETE
/v1/keys/{key_id}
Revokes the key. The operations the edge answers itself refuse it at once; every other request refuses it
within 10 seconds (the edge keeps a key's record at most 10 seconds after reading it from its primary
database, and never reads keys from a replica). The edge also pushes the revocation to nodes, so open
streams authenticated by it close within 60 seconds. Routines published with it pause their triggers.
Returns the revoked key; it stays listed for audit. Changes made with `PATCH /v1/keys/{key_id}` take effect
within the same 10 seconds.
Authentication
Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session)
Path Parameters
key_id
string
required
path
Example:
"key_01m5t5csy2wt4e3er052chyf1x"Responses
200
The revoked key.
application/jsonid
string
REQUIRED
object
string
REQUIRED
Enum:
api_keykind
string
REQUIRED
`api_key` (`b3os_sk_…`, made with `POST /v1/keys`) or `cli_token` (`b3os_pat_…`, from the device login; `created_by` is the user who approved it).
Enum:
api_key, cli_tokenclient_id
string | null
REQUIRED
The device-login client a CLI token was issued to (`b3os-cli`); null for API keys.
name
string
REQUIRED
redacted
string
REQUIRED
The start and end of the secret, for recognizing it.
org_id
string
REQUIRED
project_id
string
REQUIRED
scopes
string[]
REQUIRED
Array of:
string
spend_cap_usd
number | null
REQUIRED
spent_usd
number
REQUIRED
Spend in the current billing period.
status
string
REQUIRED
Enum:
active, revoked, expiredexpires_at
string (date-time) | null
REQUIRED
created_at
string (date-time)
REQUIRED
created_by
object
REQUIRED
type
string
REQUIRED
Enum:
user, api_keyid
string
REQUIRED
last_used_at
string (date-time) | null
REQUIRED
revoked_at
string (date-time) | null
REQUIRED
metadata
object
REQUIRED
Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of
`A-Z a-z 0-9 _ . : -`; values are at most 500 characters. B3OS never interprets them.
400
The request failed validation (`invalid_request`, `invalid_url`).
401
Missing, malformed, expired or revoked credentials (`unauthorized`).
403
Authenticated but not allowed (`forbidden`, `egress_denied`).
404
No such key in your organization (`api_key_not_found`).
429
A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500
Something failed inside B3OS (`internal`). Retry with backoff.
503
The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X DELETE 'https://beta-api.b3os.org/v1/keys/key_01m5t5csy2wt4e3er052chyf1x' \ -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/keys/key_01m5t5csy2wt4e3er052chyf1x', { method: 'DELETE', headers: { "Authorization": "Bearer YOUR_API_TOKEN" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.delete('https://beta-api.b3os.org/v1/keys/key_01m5t5csy2wt4e3er052chyf1x', headers=headers)print(response.json())
200
Response
{ "id": "key_01m5t5csy2wt4e3er052chyf1x", "object": "api_key", "kind": "api_key", "client_id": null, "name": "research agent", "redacted": "b3os_sk_ex4m…2321", "org_id": "org_01m5t5hthd29mm5wpza5ndd6mm", "project_id": "prj_01m5t3pf8heewxt65ej3dm577y", "scopes": [ "vision:run", "sandboxes:write", "sandboxes:run", "infer:run" ], "spend_cap_usd": 50, "spent_usd": 1.42, "status": "revoked", "expires_at": "2026-12-31T00:00:00.000Z", "created_at": "2026-10-25T21:00:00.000Z", "created_by": { "type": "user", "id": "usr_01m5t3jv4b5sappg7vzv1rwx6x" }, "last_used_at": "2026-10-25T21:30:00.000Z", "revoked_at": "2026-10-25T22:00:00.000Z", "metadata": {}}
API Playground
Try this endpoint
DELETE
/v1/keys/{key_id}