> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avyratech.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview

> Overview of the Tonnex REST API.

# API Overview

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

## Base URL

| Environment | URL                             |
| ----------- | ------------------------------- |
| Local       | `http://localhost:3001/api/v1`  |
| Production  | `https://api.tonnex.app/api/v1` |

## Authentication

All protected endpoints require a Bearer token in the `Authorization` header:

```bash theme={null}
curl -H "Authorization: Bearer <supabase-jwt>" \
  http://localhost:3001/api/v1/health
```

## Health Check

```bash theme={null}
GET /api/v1/health
```

Response:

```json theme={null}
{
  "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/*`.
