Onboard clients, run scans, read visibility scores, pull citations, and download client-ready PDF reports. One API key, every endpoint that powers OpenLens.Documentation Index
Fetch the complete documentation index at: https://docs.openlens.com/llms.txt
Use this file to discover all available pages before exploring further.
What it does
The REST API exposes the same operations as the dashboard:- Onboard new clients automatically. Hand the API a website URL. It researches the brand, proposes competitors and buyer-intent topics, and creates the project with prompts ready to scan.
- Run AI visibility scans across ChatGPT, Perplexity, Google AI Overviews, and DeepSeek. (Claude is gated to specific accounts.)
- Read visibility, share of voice, sentiment, citation sources, and per-attribute breakdowns programmatically.
- Download client-ready PDF reports.
- Manage projects, topics, prompts, and platforms.
Authentication
Every request needs a Clerk API key in theAuthorization header.
Get an API key
Sign in to OpenLens
Sign in. If you don’t have an account yet, sign up here. The API doesn’t provision accounts in beta, so the web sign-up is the only path.
Open your account settings
From the dashboard, click your avatar in the bottom-left corner and choose Manage account.
Name it and pick an expiry
Give the key an optional name (handy if you’re running it from multiple machines) and pick an expiration date.
Send it on every request
Base URL
application/pdf.
End-to-end example
We’ll onboard Anthropic from scratch and read back their visibility scores. Five short steps, about 11 minutes end to end. The individual steps run fast. The wait is the AI platforms thinking.Setup
Pin the base URL and the auth header so every request below can reuse them.Analyze the brand (about 30s)
POST /onboard with action: "analyze" hands the API a website URL. It reads the page, figures out what the brand does, and proposes a starting set of competitors and buyer-intent topics. Nothing is saved yet, so you can edit the result before committing. The endpoint streams progress events as Server-Sent Events. We just wait for the full response and parse the final data: line.Confirm and create the project (about 1m)
action: "confirm" takes the analysis back (with any edits), creates the project, and generates 10 prompts per topic in the background.Kick off a scan
POST /prompts/run returns immediately with a runId. A typical run is 30 prompts × 4 platforms = 120 platform responses.Wait for it to finish (5 to 15 min)
Poll every 30 seconds. Most fresh projects complete in 5 to 10 minutes. Larger ones can take 30+. If a deploy or crash interrupts a run, calling
POST /prompts/run again resumes it from where it left off.What you get back
Supported platforms
| Platform ID | Display name | Notes |
|---|---|---|
chatgpt_app | ChatGPT | All accounts |
perplexity_app | Perplexity | All accounts |
google_app | Google AI Overviews | All accounts |
deepseek | DeepSeek | All accounts |
claude | Claude | Email contact@aibread.com for access |
GET /api/settings/platforms.
Endpoint families
A quick tour of what’s available. Full request and response shapes are in the OpenAPI spec at/api/openapi.json (also rendered as the per-endpoint pages in this section).
- Onboarding.
POST /api/onboard(Server-Sent Events) withaction: analyzeoraction: confirm. - Runs.
POST /api/prompts/runto start,GET /api/prompts/statusto poll,DELETE /api/prompts/runto cancel,GET /api/prompts/resultsfor raw responses. - Metrics.
GET /api/visibility(overall, per-topic, per-attribute),GET /api/visibility/trendsfor time series,GET /api/insights/enginesfor per-platform source behavior,GET /api/insights/topicfor an AI-generated insight paragraph. - Citations.
GET /api/brand-mentions-summaryreturns top cited URLs per topic.GET /api/sourcesreturns top cited domains. - Deliverables.
GET /api/reports/visibilityreturns a client-ready PDF.GET /api/reports/runsreturns run history. - Resources. CRUD endpoints for projects, brands, topics, and prompts.
- Account.
GET /api/me/limits,GET /api/usage,GET /api/settings/platforms. (Note:/api/settings/schedulereturns410 Gone. Scheduling is per-project now. Use/api/projects/{id}/schedule.)
Common errors
| Status | Meaning |
|---|---|
400 | Missing or invalid request parameter (most often projectId) |
401 | API key missing, malformed, or revoked |
404 | Resource not found, or not owned by your account |
409 | A run is already in progress for this project |
429 | Rate limit, project cap, or daily quota hit. Body includes a code field |
500 | Server error. Retry. If persistent, email us with the request ID |