Describe the calling credential
Returns who is calling: the key or CLI token (or dashboard session, or sandbox), its organization and project, scopes, spend cap and expiry. Any valid credential may call it, whatever its scopes.
GET
/v1/keys/current
Returns who is calling: the key or CLI token (or dashboard session, or sandbox), its organization and
project, scopes, spend cap and expiry. Any valid credential may call it, whatever its scopes.
Authentication
Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session)
Responses
200
The calling principal.
application/jsonobject
string
REQUIRED
Enum:
principalkind
string
REQUIRED
Enum:
api_key, cli_token, session, sandboxkey_id
string | null
REQUIRED
user
object | null
REQUIRED
id
string
REQUIRED
email
string (email)
REQUIRED
name
string | null
REQUIRED
image_url
string (uri) | null
REQUIRED
sandbox_id
string | null
For calls from inside a sandbox.
org_id
string
REQUIRED
project_id
string
REQUIRED
scopes
string[]
REQUIRED
Array of:
string
spend_cap_usd
number | null
REQUIRED
expires_at
string (date-time) | null
REQUIRED
401
Missing, malformed, expired or revoked credentials (`unauthorized`).
403
Authenticated but not allowed (`forbidden`, `egress_denied`).
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 GET 'https://beta-api.b3os.org/v1/keys/current' \ -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/keys/current', { method: 'GET', headers: { "Authorization": "Bearer YOUR_API_TOKEN" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/keys/current', headers=headers)print(response.json())
200
Response
{ "object": "principal", "kind": "api_key", "key_id": "key_01m5t5csy2wt4e3er052chyf1x", "user": null, "org_id": "org_01m5t5hthd29mm5wpza5ndd6mm", "project_id": "prj_01m5t3pf8heewxt65ej3dm577y", "scopes": [ "vision:run", "sandboxes:write", "sandboxes:run", "infer:run" ], "spend_cap_usd": 20, "expires_at": "2026-12-31T00:00:00.000Z"}
API Playground
Try this endpoint
GET
/v1/keys/current