Overview
The Finance Agent API uses JWT (JSON Web Tokens) for authentication. After obtaining a token, include it in theAuthorization header for all authenticated requests.
Register User
Create a new user account.User email address (must be unique)
Username (must be unique)
Password (minimum 8 characters)
User’s full name
Company name
Whether registration was successful
Success or error message
Created user information
Login
Authenticate and receive a JWT token.User email address
User password
Whether login was successful
JWT access token (valid for 24 hours)
Token type (always “bearer”)
Authenticated user information
Using the Token
Include the JWT token in theAuthorization header for all authenticated requests:
Get User Profile
Retrieve the current user’s profile information.cURL
User UUID
Username
Email address
Full name
Company name
Admin status
Account creation timestamp (ISO 8601)
Get Usage Statistics
Retrieve usage statistics for rate limiting and billing.cURL
Total lifetime requests
Requests this month
Total lifetime cost ($0.02 per request)
Cost this month
Remaining requests this minute
Remaining requests this month
Token Expiration
JWT tokens expire after 24 hours. When a token expires, you’ll receive a401 Unauthorized response. Simply log in again to obtain a new token.
Security Best Practices
- Store tokens securely (e.g., in environment variables or secure storage)
- Use HTTPS for all API requests
- Implement token refresh logic before expiration
- Rotate tokens regularly in production environments