Skip to content

Overview

IndepAI REST API

Welcome to the IndepAI API documentation. This API provides programmatic access to Financial Independence calculations, portfolio management, geo-arbitrage tools, and tax optimization.

Authentication

Most endpoints require authentication via Bearer token. Include your Supabase access token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Public endpoints (like the FI Calculator) can be used without authentication but have stricter rate limits.

Rate Limiting

Rate limits are based on your subscription tier:

TierDaily LimitPer-Endpoint Limits
Starter1,000 requests50 AI Coach requests
Pro10,000 requests500 AI Coach requests

Rate limit headers are included in all responses:

  • X-RateLimit-Limit: Your daily limit
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Unix timestamp when limit resets

Errors

All errors follow a consistent format:

{
  "success": false,
  "error": "Error Type",
  "code": "ERROR_CODE",
  "details": [
    { "path": "fieldName", "message": "Error description" }
  ]
}

Common Error Codes

CodeDescription
VALIDATION_ERRORRequest body failed validation
UNAUTHORIZEDMissing or invalid authentication
FORBIDDENInsufficient permissions
NOT_FOUNDResource not found
RATE_LIMITEDRate limit exceeded
INTERNAL_ERRORServer error

Versioning

The API uses URL versioning. The current version is v1. All endpoints are prefixed with /api/v1/.

Supabase access token. Obtain via /auth/login or Supabase client.

Security scheme type: http

Bearer format: JWT