> ## Documentation Index
> Fetch the complete documentation index at: https://docs.capital.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Account and Profile

## Who am I

`GET /api/v1/whoami` · scope `read`

The account your key acts for.

```json theme={null}
{ "accountId": "acc_123" }
```

```bash REST theme={null}
curl "$CAPITALAI_API_URL/api/v1/whoami" \
  -H "Authorization: Bearer $CAPITALAI_API_KEY"
```

```ts TypeScript theme={null}
const res = await fetch(`${process.env.CAPITALAI_API_URL}/api/v1/whoami`, {
  headers: { Authorization: `Bearer ${process.env.CAPITALAI_API_KEY}` },
});
console.log(await res.json());
```

## Buying power

`GET /api/v1/account` · scope `read`

What a buy can spend, read live from tZERO. tZERO refuses any order larger than this.

| Field | Type | Description |
| - | - | - |
| `buyingPowerUsd` | number | Buying power in USD. |
| `synthetic` | boolean | `true` when no broker is connected: the figure is a fixed demo amount. |

```json theme={null}
{ "buyingPowerUsd": 10500, "synthetic": false }
```

`404` until the brokerage account is opened. `503` when tZERO does not answer within 5 seconds or is briefly unavailable; retry. `502` when tZERO cannot report this account's buying power (a refused credential or capability, an account tZERO does not know, or an answer without a figure); retrying will not help.

## Positions

`GET /api/v1/home/positions` · scope `read`

What the account holds, read live from tZERO: the USD cash row first (when tZERO reports one), then one row per security. Quantities only; price them from a quote.

| Field | Type | Description |
| - | - | - |
| `asset` | string | `USD` for cash, otherwise the security's symbol. |
| `name` | string | `US Dollar` for cash, otherwise the symbol. |
| `balance` | number | USD for cash, otherwise units held. |
| `isCash` | boolean | `true` on the cash row only; absent otherwise. |

```json theme={null}
[
  { "asset": "USD", "name": "US Dollar", "balance": 257.5, "isCash": true },
  { "asset": "NVDA", "name": "NVDA", "balance": 177.63 }
]
```

`404` until the brokerage account is opened. An empty array when tZERO lists nothing for the account. `503` when tZERO does not answer within 5 seconds or is briefly unavailable; retry. `502` when tZERO cannot report this account's holdings (a refused credential or capability, or an unusable answer); retrying will not help.

## Profile

`GET /api/me` · scope `read`

| Field | Type | Description |
| - | - | - |
| `id` | string | Account ID. |
| `email` | string \| null | Email address. |
| `email_verified` | boolean | Whether the email is verified. |
| `first_name` | string \| null | Given name. |
| `last_name` | string \| null | Family name. |
| `phone` | string \| null | Phone number. |
| `account_type` | `individual` \| `business` \| null | Set once onboarding is submitted. |
| `created_at` | string | When the account was created. |
| `wallets` | `WalletInfo[]` | Wallet addresses on the account: `address`, `chain`, `is_primary`. |

This endpoint's fields are `snake_case`; the `/api/v1` endpoints use `camelCase`.

```bash REST theme={null}
curl "$CAPITALAI_API_URL/api/me" \
  -H "Authorization: Bearer $CAPITALAI_API_KEY"
```

```ts TypeScript theme={null}
const res = await fetch(`${process.env.CAPITALAI_API_URL}/api/me`, {
  headers: { Authorization: `Bearer ${process.env.CAPITALAI_API_KEY}` },
});
console.log(await res.json());
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.