Skip to main content

API Overview

The Tonnex API is built with NestJS and runs as a separate application (apps/api).

Base URL

EnvironmentURL
Localhttp://localhost:3001/api/v1
Productionhttps://api.tonnex.app/api/v1

Authentication

All protected endpoints require a Bearer token in the Authorization header:
curl -H "Authorization: Bearer <supabase-jwt>" \
  http://localhost:3001/api/v1/health

Health Check

GET /api/v1/health
Response:
{
  "status": "ok",
  "service": "tonnex-api",
  "timestamp": "2026-02-13T10:00:00.000Z"
}

Web Proxy

The Next.js web app proxies /api/v1/* requests to the NestJS API. In development, browser requests to http://localhost:3000/api/v1/* are automatically forwarded to http://localhost:3001/api/v1/*.