Documentation

API Reference

Ignitra exposes these API routes.

POST /api/chat

Send a message and receive a streaming AI response.

Request body:

{
  "messages": [{ "role": "user", "content": "Hello" }],
  "conversationId": "uuid" // optional
}

Response: Server-Sent Events (streaming)

Auth: Required (session cookie)

GET /api/usage

Get the authenticated user's token usage statistics.

Response (shape may vary by implementation):

{
  "today": { "tokens": 4520, "cost": 0.07, "messages": 12 },
  "month": { "tokens": 142300, "cost": 2.14, "messages": 89 },
  "dailyBreakdown": [],
  "modelBreakdown": [],
  "limits": { "daily": 100000, "monthly": 1000000 }
}

Auth: Required

POST /api/webhooks/stripe

Stripe webhook handler. Processes subscription changes, payment events, and updates user plans accordingly.

Auth: Stripe signature verification

Auth callback

Supabase OAuth flows use the callback route configured in your Supabase project (typically under /auth/callback or similar — match your app's auth setup).

GET /api/health

Health check endpoint. Returns

{ "status": "ok" }

Note: If this route is not present in your fork, add it or use Vercel's deployment checks instead.

API Reference | Ignitra Docs