POST /v1/auth/invites/redeem
Turns a beta invite code into an organization with a first project and a first API key (shown once), and makes them the session's active organization and project. The key gets the default key scopes (`x-b3os-default-key-scopes` in common.yaml): read, write and run on vision, render, sandboxes, routines, actions and infer, plus `vault:read`, `vault:run` and `platform:read`; never `*`, `vault:write` or `platform:write`. `setup.shell` is the line to paste (`export B3OS_API_KEY=…`) and `setup.prompt` the text for the dashboard's "Copy setup prompt" button.

Authentication

API Key (cookie: __Host-b3os_session)

Header Parameters

x-b3os-csrf string required header
The `csrf_token` from `GET /v1/auth/session`.
Example: "9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"

Request Body required

application/json
code string REQUIRED
org_name string
project_name string

Responses

201 The organization, project and first key.
application/json
object string REQUIRED
Enum: invite_redemption
org object REQUIRED
id string REQUIRED
object string REQUIRED
Enum: organization
name string REQUIRED
slug string REQUIRED
role string | null REQUIRED
The caller's role; `null` for API keys.
Enum: owner, admin, member, null
plan string REQUIRED
Enum: beta
created_at string (date-time) 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.
project object REQUIRED
id string REQUIRED
object string REQUIRED
Enum: project
org_id string REQUIRED
name string REQUIRED
created_at string (date-time) REQUIRED
updated_at string (date-time) 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.
key object REQUIRED
A new key, with its secret (returned only once).
id string REQUIRED
object string REQUIRED
Enum: api_key
kind 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_token
client_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, expired
expires_at string (date-time) | null REQUIRED
created_at string (date-time) REQUIRED
created_by object REQUIRED
type string REQUIRED
Enum: user, api_key
id 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.
secret string REQUIRED
setup object REQUIRED
shell string REQUIRED
`export B3OS_API_KEY=…`
prompt string REQUIRED
Setup text to paste into an agent.
400 The invite code is unknown or expired (`invite_code_invalid`).
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
409 The invite code was already redeemed (`invite_code_used`).
413 The request body exceeds this operation's limit.
415 The Content-Type is not accepted by this operation.
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 POST 'https://beta.b3os.org/v1/auth/invites/redeem' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'x-b3os-csrf: 9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d' \  -H 'Content-Type: application/json' \  -d '{  "code": "B3OS-7K2M-9QXD",  "org_name": "Acme"}'
const response = await fetch('https://beta.b3os.org/v1/auth/invites/redeem', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json",      "x-b3os-csrf": "9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"  },  body: JSON.stringify({    "code": "B3OS-7K2M-9QXD",    "org_name": "Acme"  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN',    'x-b3os-csrf': '9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d'}response = requests.post('https://beta.b3os.org/v1/auth/invites/redeem', headers=headers, json={  "code": "B3OS-7K2M-9QXD",  "org_name": "Acme"})print(response.json())
201 Response
{  "object": "invite_redemption",  "org": {    "id": "org_01m5t5hthd29mm5wpza5ndd6mm",    "object": "organization",    "name": "Acme",    "slug": "acme",    "role": "owner",    "plan": "beta",    "created_at": "2026-10-25T22:15:00.000Z",    "metadata": {}  },  "project": {    "id": "prj_01m5t3pf8heewxt65ej3dm577y",    "object": "project",    "org_id": "org_01m5t5hthd29mm5wpza5ndd6mm",    "name": "default",    "created_at": "2026-10-25T22:15:00.000Z",    "updated_at": "2026-10-25T22:15:00.000Z",    "metadata": {}  },  "key": {    "id": "key_01m5t5gb92a5zncjx654gevx4p",    "object": "api_key",    "kind": "api_key",    "client_id": null,    "name": "default",    "redacted": "b3os_sk_ex4m…2321",    "org_id": "org_01m5t5hthd29mm5wpza5ndd6mm",    "project_id": "prj_01m5t3pf8heewxt65ej3dm577y",    "scopes": [      "vision:read",      "vision:write",      "vision:run",      "render:read",      "render:write",      "render:run",      "sandboxes:read",      "sandboxes:write",      "sandboxes:run",      "routines:read",      "routines:write",      "routines:run",      "actions:read",      "actions:write",      "actions:run",      "infer:read",      "infer:write",      "infer:run",      "vault:read",      "vault:run",      "platform:read"    ],    "spend_cap_usd": null,    "spent_usd": 0,    "status": "active",    "expires_at": null,    "created_at": "2026-10-25T22:15:00.000Z",    "created_by": {      "type": "user",      "id": "usr_01m5t3jv4b5sappg7vzv1rwx6x"    },    "last_used_at": null,    "revoked_at": null,    "metadata": {},    "secret": "b3os_sk_ex4mple7ex4mple7ex4mple7ex4mple7_957a2321"  },  "setup": {    "shell": "export B3OS_API_KEY=b3os_sk_ex4mple7ex4mple7ex4mple7ex4mple7_957a2321",    "prompt": "Use B3OS for browsing, sandboxes and routines. The API key is in B3OS_API_KEY; docs are at https://docs.beta.b3os.org/llms.txt."  }}
Ask a question... ⌘I