API reference · Account and tokens
List tokens
GET/v1/tokens
Your API tokens, without their secrets.
On this page
Auth. An API token: Authorization: Bearer lb_… (create one). Signed-in web sessions work too.
Limits. Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).
Request
curl "https://api.langbot.ai/v1/tokens" \
-H "Authorization: Bearer $LANGBOT_API_TOKEN"from langbot import LangbotClient
async with LangbotClient() as lb: # reads LANGBOT_API_TOKEN
for t in await lb.tokens():
print(t["id"], t["name"], t["last_used_at"])import { LangbotClient } from "@langbotai/sdk";
const lb = new LangbotClient(); // reads LANGBOT_API_TOKEN
const tokens = await lb.tokens();
console.log(tokens);Response
200 OK
{ "tokens": [ { "id": "tok_01J9…", "name": "laptop", "scopes": ["read", "stream", "subscribe"], "agent": null, "created_at": 1760050000000, "last_used_at": 1760137000000 } ] }Errors
| Status | code | When |
|---|---|---|
| 401 | auth_required | No token was sent. |
| 401 | token_invalid | The token was not recognised (mistyped, revoked or expired). |
| 429 | rate_limited | Over your request budget; wait Retry-After seconds. |
Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.