Documentation
← Back to home

Get started in 5 minutes

1

Get your API key

Enter your email at https://finprim.dev/ to receive your API key instantly.

2

Install the CLI

npm install -g finprim-cli
3

Set your API key

export FINPRIM_API_KEY=sk_finprim_xxx
4

Run your first command

finprim runway

Connect your bank account

Required to use financial endpoints with real data. Finprim uses Plaid to securely link your bank in seconds.

Connect your bank →

Powered by Plaid — read-only access, we never store your credentials.

Authentication

All API endpoints require your API key in the Authorization header:

curl https://finprim.dev/runway \ -H "Authorization: Bearer sk_finprim_xxx"

Endpoints

GET /ping

Health check — verify the API is running.

curl https://finprim.dev/ping
{ "name": "Finprim API", "version": "1.0.0", "status": "ok" }
GET /runway

Calculate runway from real-time Plaid balance and 90-day burn rate.

curl https://finprim.dev/runway \ -H "Authorization: Bearer sk_finprim_xxx"
{ "current_balance": 84200, "monthly_burn": 12400, "runway_months": 6.8, "runway_date": "2026-10-15", "alert": "WARNING", "balance_source": "plaid_realtime", "message": "Warning: at the current burn rate..." }
GET /report

Full financial summary for a given month.

  • month YYYY-MM format — defaults to current month
curl "https://finprim.dev/report?month=2026-03" \ -H "Authorization: Bearer sk_finprim_xxx"
{ "period": "2026-03", "total_spent": 38200, "monthly_burn": 12733, "top_categories": [ { "category": "PAYROLL", "total": 18000 }, { "category": "SOFTWARE", "total": 6400 }, { "category": "TRAVEL", "total": 3200 } ], "transaction_count": 47, "biggest_transaction": { ... } }
GET /transactions

Recent transactions formatted for LLMs.

  • days Lookback window in days — default: 30
curl "https://finprim.dev/transactions?days=30" \ -H "Authorization: Bearer sk_finprim_xxx"
[ { "date": "2026-03-28", "amount": 299, "merchant": "AWS", "category": "SOFTWARE" }, ... ]
GET /burn-rate

Average monthly burn over N months.

  • months Number of months to analyze — default: 3
curl "https://finprim.dev/burn-rate?months=3" \ -H "Authorization: Bearer sk_finprim_xxx"
{ "total_spent": 37200, "monthly_burn": 12400, "months_analyzed": 3, "biggest_expense_category": "PAYROLL" }
GET /subscriptions

Detect recurring payments automatically from 12 months of transaction history.

curl https://finprim.dev/subscriptions \ -H "Authorization: Bearer sk_finprim_xxx"
[ { "merchant": "GitHub", "amount": 21, "frequency": 12, "estimated_monthly_cost": 21, "category": "SOFTWARE" }, ... ]
GET /categorize

Expenses grouped by category for a given month.

  • month YYYY-MM format — defaults to current month
curl "https://finprim.dev/categorize?month=2026-03" \ -H "Authorization: Bearer sk_finprim_xxx"
[ { "category": "PAYROLL", "total": 18000, "count": 4, "percentage": 47.12 }, { "category": "SOFTWARE", "total": 6400, "count": 18, "percentage": 16.75 }, ... ]
GET /anomaly

Detect abnormal expenses versus 90-day merchant history.

  • threshold Percentage deviation to trigger alert — default: 50
curl "https://finprim.dev/anomaly?threshold=50" \ -H "Authorization: Bearer sk_finprim_xxx"
{ "anomalies": [ { "merchant": "AWS", "expected_amount": 299, "actual_amount": 1840, "delta_percent": 515.38, "date": "2026-03-01", "alert": "HIGH" } ], "total_anomalies": 1, "scan_period_days": 90 }
GET /cashflow

30/60/90-day treasury projection based on average monthly net cash flow.

curl https://finprim.dev/cashflow \ -H "Authorization: Bearer sk_finprim_xxx"
{ "current_balance": 84200, "avg_monthly_burn": 12400, "avg_monthly_revenue": 9800, "avg_monthly_net": -2600, "projected_balance_30d": 81600, "projected_balance_60d": 79000, "projected_balance_90d": 76400, "trend": "declining", "weeks_until_critical": 28.8, "balance_source": "plaid_realtime" }