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

# Account

> The account and API key behind a request, the key's scopes, and whether production trading is available to you.

The account entity tells your program **who it is**: which Bullionwale account and which API key a request runs as, what that key may do, and whether production trading is open to the account. It has one call, `GET /me`. Call it whenever you install or rotate a key.

| Call | Endpoint | Scope |
| - | - | - |
| [Who am I](#read-your-account) | `GET /me` | `account:read` |

The path sits under the test base path `/api/trading/test/v1` or the production base path `/api/trading/v1`. Both return the same object; the test path takes a test key and the production path a live key (see [Test and production](/environments)).

## The account object

| Field | Type | Meaning |
| - | - | - |
| `login_id` | string | Your Bullionwale login. |
| `firm_name` | string or null | Your firm's name on the account. |
| `environment` | string | `test` or `production`: the environment of the key you sent. |
| `key_id` | string | The key's public id. Safe to quote to Bullionwale; never quote the secret. |
| `key_name` | string | The name the key was issued with, for example `order-bot`. |
| `scopes` | array of strings | What the key may do (see [Scopes](/getting-access#scopes)). |
| `production_trading_available` | boolean | `true` when production orders are open to your account right now. A hint, not a promise: every order is checked again when it is placed. |

## Read your account

<CodeGroup>
  ```bash curl theme={null}
  curl -s https://api.bullionwale.com/api/trading/test/v1/me \
    -H "X-API-Key: $BULLIONWALE_API_KEY"
  ```

  ```python Python theme={null}
  import os
  import requests

  BASE = "https://api.bullionwale.com/api/trading/test/v1"
  HEADERS = {"X-API-Key": os.environ["BULLIONWALE_API_KEY"]}

  me = requests.get(f"{BASE}/me", headers=HEADERS, timeout=10).json()
  print(me["key_id"], me["scopes"], me["production_trading_available"])
  ```
</CodeGroup>

```json 200 OK theme={null}
{
  "login_id": "your-login",
  "firm_name": "Your Firm",
  "environment": "test",
  "key_id": "3c1f0a9b7d2e4c6a8b10",
  "key_name": "order-bot",
  "scopes": ["account:read", "orders:read", "orders:write"],
  "production_trading_available": false
}
```

`production_trading_available` is the same on the test and production paths, so you can check it with either key before you send a real order. See [Production access requirements](/production-access#check-before-you-trade).

## Errors

The account call shares the refusals of every call. The ones you will meet most:

| Code | Status | Meaning |
| - | - | - |
| `missing_credential` | 401 | No `X-API-Key` header. |
| `invalid_credential` | 401 | Unknown key or wrong secret. |
| `wrong_environment` | 401 | A test key on the production path, or a live key on the test path. |
| `api_access_disabled` | 403 | API access is off for your account. |
| `insufficient_scope` | 403 | The key does not have `account:read`. |
| `rate_limited` | 429 | The key's read budget is used up. Wait `Retry-After` seconds. |

The full list is in [Errors](/errors#error-codes).


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