API · v1

Build on Brix.

Bring your subscriptions, free trials, and reminders into your own apps: a budget spreadsheet, a Discord bot, a home dashboard, or a shortcut on your phone. Every request acts for one Brix user with a key they create and can revoke.

View as Markdownllms.txt

Quickstart

  1. Sign in to Brix and open Developers → API keys. Name the key, pick only the permissions you need, and copy it. It’s shown once.
  2. Store it as an environment variable on your server, e.g. BRIX_API_KEY. Never put it in a web page, a mobile app bundle, or a public repo.
  3. Make your first call:
curl https://www.usebrix.app/api/v1/me \
  -H "Authorization: Bearer $BRIX_API_KEY"

JavaScript

const res = await fetch("https://www.usebrix.app/api/v1/charges/upcoming?days=7", {
  headers: { Authorization: `Bearer ${process.env.BRIX_API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const { data } = await res.json();
for (const c of data)
  console.log(`${c.merchant}: $${c.amount} on ${c.next_date}`);

Python

import os, requests

r = requests.post(
    "https://www.usebrix.app/api/v1/reminders",
    headers={"Authorization": f"Bearer {os.environ['BRIX_API_KEY']}"},
    json={"merchant": "Spotify", "when": "2 days before"},
    timeout=10,
)
r.raise_for_status()
print(r.json()["remind_at"])

Authentication & permissions

Send the key as a bearer token: Authorization: Bearer brix_sk_…. Brix stores only a SHA-256 hash of it. Each user can have up to 5 active keys; revoking one stops it immediately. Each key carries scopes, and an endpoint without its scope returns 403 insufficient_scope.

ScopeAllows
charges:readRead charges, upcoming charges, and the spending summary.
charges:writeAdd trials and mark charges to cancel or active.
reminders:readList reminders.
reminders:writeCreate and delete reminders.
cards:readList single-use cards (masked; never card numbers).
news:readRead subscription news about your merchants.
refunds:readRead school refunds and their plans.
practice:readRead the practice portfolio (virtual money): value, positions, rules, orders.

Conventions

Base URL
https://www.usebrix.app/api/v1
Format
JSON in and out, snake_case fields, amounts in USD as decimal numbers, dates as YYYY-MM-DD. Lists come back as { "object": "list", "data": [...] }.
Rate limit
120 requests per minute per key. Every response includes X-RateLimit-Limit and X-RateLimit-Remaining; a 429 includes Retry-After.
Retries
POST /trials accepts an Idempotency-Key header; repeating it returns the first result. Creating the same reminder twice is already safe.
Versioning
Responses carry Brix-Version: 2026-10-24. We add fields without notice; we never remove or rename fields within /v1.
Request IDs
Every response has an X-Request-Id, also inside error bodies. Include it when you report a problem.

Errors

{
  "error": {
    "type": "insufficient_scope",
    "message": "This key is missing the `charges:write` scope.",
    "request_id": "req_4f1c9a0b2e7d4c3a8b19"
  }
}
StatusTypeMeaning
400invalid_requestA parameter or body field is missing or invalid.
401authentication_failedThe key is missing, malformed, unknown, or revoked.
403insufficient_scopeThe key doesn't have the scope this endpoint needs.
404not_foundNo charge or reminder with that ID belongs to this user.
409conflictThe change conflicts with the current state, e.g. a sent reminder.
413request_too_largeThe body is larger than 64 KB.
429rate_limitedMore than 120 requests in a minute. Wait for `Retry-After`.
502upstream_unavailableA provider such as the news service didn't respond.
500api_errorSomething failed on our side. Retry; share the request ID if it continues.

Endpoint reference

The full machine-readable spec is at /api/v1/openapi.json (OpenAPI 3.1). Import it into Postman, Insomnia, or a client generator.

GET/v1/me

Check your key. Returns the key you authenticated with and its scopes. Works with any scope; use it to verify setup.

Scope: any valid key

curl "https://www.usebrix.app/api/v1/me" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/charges

List charges. Every subscription and trial Brix knows about, sorted by next expected date.

Scope: charges:read

curl "https://www.usebrix.app/api/v1/charges?status=active" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/charges/upcoming

Upcoming charges. Active subscriptions and trials expected within the next `days` days (default 14, max 90).

Scope: charges:read

curl "https://www.usebrix.app/api/v1/charges/upcoming?days=7" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/charges/{id}

Get a charge. One charge by ID.

Scope: charges:read

curl "https://www.usebrix.app/api/v1/charges/ch_123" \
  -H "Authorization: Bearer $BRIX_API_KEY"

PATCH/v1/charges/{id}

Mark to cancel / reactivate. Set `status` to `to_cancel` to mark a charge for cancellation, or `active` to undo it. Brix never cancels at the merchant; the response includes the merchant's cancel link when known.

Scope: charges:write

curl -X PATCH "https://www.usebrix.app/api/v1/charges/ch_123" \
  -H "Authorization: Bearer $BRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"to_cancel"}'

POST/v1/trials

Add a free trial. Track a free trial so Brix reminds you before it bills. Send an `Idempotency-Key` header to make retries safe.

Scope: charges:write

curl -X POST "https://www.usebrix.app/api/v1/trials" \
  -H "Authorization: Bearer $BRIX_API_KEY" \
  -H "Idempotency-Key: trial-notion-nov" \
  -H "Content-Type: application/json" \
  -d '{"merchant":"Notion AI","end_date":"2026-11-15","amount":10}'

GET/v1/summary

Spending summary. Monthly subscription total, counts, the next 14 days, and the estimated amount avoided this month.

Scope: charges:read

curl "https://www.usebrix.app/api/v1/summary" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/reminders

List reminders. Scheduled and sent reminders, earliest first.

Scope: reminders:read

curl "https://www.usebrix.app/api/v1/reminders" \
  -H "Authorization: Bearer $BRIX_API_KEY"

POST/v1/reminders

Create a reminder. Remind the user about a charge. Identify it by `charge_id` or `merchant`. `when` accepts a future `YYYY-MM-DD`, an ISO timestamp, or `N days before`. Delivery is WhatsApp when the user enabled it, otherwise in the app.

Scope: reminders:write

curl -X POST "https://www.usebrix.app/api/v1/reminders" \
  -H "Authorization: Bearer $BRIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"merchant":"Spotify","when":"2 days before"}'

DELETE/v1/reminders/{id}

Delete a reminder. Removes a reminder that hasn't been sent yet.

Scope: reminders:write

curl -X DELETE "https://www.usebrix.app/api/v1/reminders/manual:…" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/cards

List cards. Single-use cards created in Brix. Only the last four digits are returned. Creating cards is not available through the API; it requires confirmation in the app.

Scope: cards:read

curl "https://www.usebrix.app/api/v1/cards" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/news

Merchant news. Recent articles about pricing or renewal changes at the user's top merchants. Articles don't confirm a change to the user's own plan.

Scope: news:read

curl "https://www.usebrix.app/api/v1/news" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/refunds

List refunds. School refunds (aid left after tuition) Brix detected or the user added, with any saved plan. `loan_amount` is the borrowed part; federal Direct Loan money can be returned within 120 days without interest.

Scope: refunds:read

curl "https://www.usebrix.app/api/v1/refunds" \
  -H "Authorization: Bearer $BRIX_API_KEY"

GET/v1/practice

Practice portfolio. The user's paper-trading portfolio: virtual cash, positions at live prices, gain compared with the S&P 500 (VOO), auto-invest rules, and recent orders. No real money is involved. `null` when the user hasn't started one.

Scope: practice:read

curl "https://www.usebrix.app/api/v1/practice" \
  -H "Authorization: Bearer $BRIX_API_KEY"

What the API doesn’t do, and why

  • Create cards. A card is a payment instrument, so it needs the user’s confirmation in the app (and their PIN for voice). The API can list cards, masked to the last four digits.
  • Link banks. Bank linking runs through Plaid’s secure screen in the app. Linked charges show up in /charges with source: "plaid".
  • Chat with the assistant. Each conversation runs a language model, which costs money per message, so it stays in the app, WhatsApp, and voice.
  • Cancel at the merchant. Brix never cancels or moves money. Marking a charge to_cancel records the decision and returns the merchant’s cancel link.
  • Act for other people. Keys are personal. There’s no OAuth for third-party apps yet; build for yourself, or have each user paste their own key.

Data & safety

Charges from linked banks are Plaid sandbox data; cards are Lithic sandbox cards and can’t spend real money. Treat a key like a password: anyone holding it can read that user’s subscriptions. If one leaks, revoke it on the Developers page and create a new one.

Run it yourself

Brix is open source. The code, setup guide and tests are on GitHub. A local copy runs as a demo with sample data and no accounts.

Stack

  • Next.js 16 App Router, route handlers for the API, React 19, TypeScript
  • Firebase Auth for sign-in, Firestore for charges, reminders and keys
  • Plaid sandbox, read-only recurring transactions
  • Anthropic the Brix agent behind web chat, WhatsApp and voice
  • Twilio WhatsApp reminders and phone verification
  • Vapi phone calls with Brix
  • Lithic sandbox single-use cards
  • Vercel hosting and the reminder cron

Local demo (Node 22+)

git clone https://github.com/Timeless-Dave/brix
cd brix
npm install
cp .env.example .env.local
npm run dev

The example file turns on BRIX_DEMO_MODE and NEXT_PUBLIC_BRIX_DEMO_MODE, which skip sign-in and share one sample account. Both must be false in production. Checks: npm run lint, npm run typecheck, npm test and npx playwright test.

Environment variables

Names from .env.example. Leave a provider’s values empty to keep that integration off.

AreaVariables
DemoBRIX_DEMO_MODENEXT_PUBLIC_BRIX_DEMO_MODEAPP_URL
FirebaseNEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_APP_IDFIREBASE_ADMIN_PROJECT_IDFIREBASE_ADMIN_CLIENT_EMAILFIREBASE_ADMIN_PRIVATE_KEY
PlaidPLAID_CLIENT_IDPLAID_SECRETPLAID_ENV
AnthropicANTHROPIC_API_KEYANTHROPIC_MODEL
TwilioTWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_WHATSAPP_FROMTWILIO_PHONE_NUMBERNEXT_PUBLIC_TWILIO_PHONE_NUMBERTWILIO_VERIFY_SERVICE_SIDNEXT_PUBLIC_WHATSAPP_NUMBERNEXT_PUBLIC_WHATSAPP_JOIN_CODE
VapiVAPI_API_KEYVAPI_ASSISTANT_IDVAPI_PHONE_NUMBER_IDVAPI_SERVER_SECRETNEXT_PUBLIC_VAPI_PHONE_NUMBER
LithicLITHIC_API_KEYLITHIC_ENV
OtherNEWS_API_KEYCRON_SECRETADMIN_EMAILS