> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Account & Org

> API keys, subaccounts, usage metering, and the authenticated actor.

Issue API keys, isolate customers into subaccounts, and meter usage per subaccount from a single organization.

The `apiKeys`, `subaccounts`, and `usage` clients are reachable two ways: directly on the client (`bctrl.apiKeys`) or grouped under `bctrl.account.apiKeys`. Both point at the same client.

## Who am I

Check the actor behind the current API key:

```ts
const me = await bctrl.auth.whoami();
```

## API keys

```ts
const created = await bctrl.apiKeys.create({ name: "ci-key" });
console.log(created.secret);   // shown once - store it now
console.log(created.data.id);

const { data } = await bctrl.apiKeys.list();
await bctrl.apiKeys.delete(created.data.id);
```

The `secret` is returned only at creation time. Issue a key scoped to a subaccount with `subaccountId`.

## Subaccounts

Each subaccount is an isolated, separately-billed environment for one of your customers, under your organization.

```ts
const sub = await bctrl.subaccounts.create({
  name: "Acme Corp",
  externalId: "acme",
});

const { data } = await bctrl.subaccounts.list();
const one = await bctrl.subaccounts.get(sub.id);

await bctrl.subaccounts.update(sub.id, { name: "Acme Inc" });
await bctrl.subaccounts.archive(sub.id);
```

A parent-org key can act on any subaccount with `?subaccountId=`; a subaccount-scoped key is automatically confined to its own subaccount.

## Usage

Read organization usage, or per-subaccount usage:

```ts
const org = await bctrl.usage.get();
const perSub = await bctrl.subaccounts.usage.list();
```

## Next

* [Spaces](/sdk/spaces) - scope work within a subaccount
* [SDK Essentials](/sdk/essentials) - pagination, errors, idempotency
* [API Reference](/api) - every account endpoint