API Overview
OpenFinance exposes a set of API routes that power the web application. These routes handle authentication, file uploads, statement processing, and AI chat.Base URL
When running locally, the base URL is:BETTER_AUTH_URL.
API Routes
| Route | Method | Description |
|---|---|---|
/api/auth/** | Various | BetterAuth authentication endpoints |
/api/upload | POST | Upload bank statement PDF files |
/api/process-statement | POST | Trigger AI processing of an uploaded statement |
/api/chat | POST | Send a message to the AI financial advisor |
Authentication
All API routes (except/api/auth/**) require an authenticated session. Requests must include the session cookie set by BetterAuth during login.
See Authentication for details on how sessions work.
Request Format
API routes accept JSON request bodies unless otherwise noted (file uploads usemultipart/form-data).
Response Format
All API routes return JSON responses. Errors follow a consistent format:UIMessageStreamResponse format.