# Brex

> Brex corporate cards and spend management - read accounts, transactions, expenses, budgets, and team members.

Lets an agent read your Brex corporate-card data - accounts, card transactions, expenses, budgets, and team members - and create budgets via the Brex API v2.

## What it can do

| Method | What it does |
| --- | --- |
| `brex_me` | Get the authenticated API token owner and account id; call first. |
| `brex_accounts_list` | List all Brex accounts (subsidiaries) with name, status, currency. |
| `brex_account_get` | Get one account's details by account id. |
| `brex_transactions_list` | List card transactions for an account, filtered by posted-at date range. |
| `brex_transaction_get` | Get one card transaction by id - amount, merchant, date, status. |
| `brex_expenses_list` | List expenses for an account, filtered by date range and status. |
| `brex_expense_get` | Get one expense by id - amount, status, receipts, approval history. |
| `brex_budgets_list` | List budgets for an account with limit, dates, and current spend. |
| `brex_budget_get` | Get one budget by id - definition, remaining balance, spend vs limit. |
| `brex_budget_create` | Create a budget (name, limit, start/end dates); write action - confirm first. |
| `brex_users_list` | List team members for an account with names, emails, roles, ids. |
| `brex_user_get` | Get one team member by id - name, email, role, status. |

## How to get credentials

You need admin access to your Brex account to create a developer token.

1. Open [dashboard.brex.com/settings/developer](https://dashboard.brex.com/settings/developer).
2. Create a new API key / developer token.
3. Grant the scopes the agent needs (e.g. read on accounts, transactions, expenses, budgets, users; write on budgets if you want `brex_budget_create`).
4. Copy the generated token.

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `BREX_API_KEY` | Brex dashboard -> Settings -> Developer -> create API key |
