Fully typed
Request bodies, query params, and responses are typed straight from the specs. Every method also carries the operation’s full description inline.
import { Brex } from 'brex';
const brex = new Brex({ token: process.env.BREX_TOKEN! });
// Typed responses, auto-pagination, idempotency — all built in.for await (const expense of brex.expenses.list({ 'expand[]': ['merchant'] })) { console.log(expense.id, expense.merchant?.raw_descriptor);}Fully typed
Request bodies, query params, and responses are typed straight from the specs. Every method also carries the operation’s full description inline.
Tree-shakeable
Import one API via a subpath (brex/payments) and the other nine never
enter your bundle — about 3.5 kB min for a single API.
Runs everywhere
Native fetch, zero runtime dependencies, ESM-only. Node ≥ 20.19
(including require()), Bun, Deno, browsers, and edge runtimes.
Auto-pagination
Every list method is both a promise and an async iterator — await a page,
or for await across all of them.
Idempotency built in
Idempotency-Key headers are sent automatically wherever Brex requires
them, with an auto-generated UUID by default.
LLM-friendly
Every page is available as raw Markdown (add .md to any URL), plus
/llms.txt and /llms-full.txt.