Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
---
title: "Authentication"
description: "How to authenticate API requests to the Ansvisor server."
---
## API keys (Public Metrics API)
The versioned `/api/v1/*` endpoints on the **web app** authenticate with long-lived Ansvisor API keys (prefix `ans_`), created under **Settings → API Keys** in the dashboard:
```bash
curl "https://app.ansvisor.com/api/v1/brands" \
-H "Authorization: Bearer ans_..."
```
This is the right choice for external integrations — Looker Studio, Sheets, scripts, and the [MCP server](/guides/mcp-server). See the [Metrics API reference](/api-reference/metrics) for the endpoint list.
## Bearer token
All `/api/*` endpoints on the Ansvisor server require a Supabase JWT bearer token in the `Authorization` header:
```bash
curl https://api.your-domain.com/api/health \
-H "Authorization: Bearer <SUPABASE_JWT>"
```
## Getting a token
The cleanest way is via the Supabase JS client in your own backend code:
```ts
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
const {
data: { session },
} = await supabase.auth.signInWithPassword({
email,
password,
});
const token = session.access_token;
```
The web app does this automatically — every server action and fetch attaches the current session token transparently.
## Cron endpoints
A handful of internal endpoints under `/api/internal/*` (used by Vercel Cron and the Stripe success callback) authenticate via a shared `CRON_SECRET` instead of user tokens:
```bash
curl -X POST https://api.your-domain.com/api/internal/daily-tracking \
-H "Authorization: Bearer $CRON_SECRET"
```
The same secret must be configured on both sides (Vercel env + server env).
## Public endpoints
Three endpoints don't require any auth:
- `GET /t.js` — tracking pixel script
- `POST /track/{trackingCode}` — tracking pixel beacon (the tracking code identifies the brand; rate-limited)
- `GET /` — basic uptime check, returns `{ "status": "ok", "service": "aeo-server", "mode": "cloud" | "self-hosted", "timestamp": "..." }`
<Note>
The `/api/health` endpoint IS auth-protected — by design, it returns the
authenticated user's ID. For uptime monitoring, use `GET /` instead.
</Note>
<Card
title="Continue: Brands API"
icon="arrow-right"
href="/api-reference/brands"
>
CRUD endpoints for managing brands programmatically.
</Card>