# Agent Skill Source: https://docs.preuve.ai/agent-skill Your agent validates ideas without burning a paid scan. Your agent can score ideas without spending a deep scan by accident. The MCP server is the tools; this file is the judgment: starter vs deep, when to wait, when a retry is safe. ## What it prevents Without this, agents tend to make four mistakes (we tested): 1. **Retrying with a new id.** A fresh `clientRunId` after every failure can spend a second deep scan. Retry with the **same** id if the run never attached a report (it resets, already refunded). Only a run that already has a report needs a new id. 2. **Exporting to "see what's there."** The export never returns partial data. Not ready is always a `409`, not a failure. Enrich, then export. 3. **Skipping citations on starter scans.** `details.citations` exists on every tier. Agents without the skill assume it's deep-only. 4. **Giving up on `503 INSUFFICIENT_TIME_BUDGET`.** A founder-fit call that ran out of clock succeeds if you call enrich again. ## Install (Claude Code) Save the skill below as `.claude/skills/preuve-agent-api/SKILL.md` in your project, or `~/.claude/skills/preuve-agent-api/SKILL.md` for all projects. Claude Code picks it up on its own. You can also fetch this page as Markdown: `https://docs.preuve.ai/agent-skill.md`. ## The skill ````markdown theme={null} --- name: preuve-agent-api description: >- Validate startup or business ideas with real market evidence through the Preuve AI MCP server (preuve-agent-api). Use this skill whenever the user wants to validate, score, stress-test, or compare startup ideas, run a market viability analysis, screen a list of ideas, check founder fit, find proof of demand, generate startup ideas, or export structured validation data, even if they never say "Preuve", whenever the Preuve MCP tools (start_analysis, get_analysis, enrich_analysis, export_analysis, generate_ideas, get_agency) are available. It encodes the correct multi-step workflow (start → poll → enrich → export), how to avoid accidentally spending paid deep-scan quota, module generation caps, and error/retry semantics. --- # Preuve Agent API (MCP) Preuve AI analyzes startup ideas against live market evidence (60+ sources) and returns a scored verdict with risks, competitors, and citations. This skill is the operating manual for its MCP server. The tools are thin wrappers over an async pipeline: analyses take minutes, results are fetched in stages, and one of the two scan types costs real money. Follow the workflows below and you will never burn quota by accident or hit an avoidable 409. ## Setup (once) Two transports, same six tools and two prompts (`validate_idea` and `generate_ideas`, user-picked, not model-invoked). Five cover your own ideas; `get_agency` and the `workspace: "agency"` switch on `start_analysis`, `get_analysis` and `export_analysis` act on a Consultant or Agency workspace, and each needs one specific scope: starting a client project needs `agency:write`, while `get_agency` and the two agency reads need `agency:read`. The two are enforced per route, so neither implies the other. Those two are never granted implicitly, so a key created before 2026-09-09 (or created since without asking for them) gets `403 INSUFFICIENT_SCOPE` on every Agency call. A key's scopes are fixed at creation, so recovery means a new grant. Reconnecting the OAuth connector and approving the Agency permissions works on any plan, free included, but only if that client rebuilds its scope request from our discovery document rather than replaying a cached one: check the consent screen actually lists the Agency permissions before approving, because reconnecting revokes the current key either way. Creating a new key by hand with Agency access selected also works (in a workspace's [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys) it is on by default), and needs either a paid personal plan or membership of a Consultant or Agency workspace with an active subscription or a one-time unlock, so a collaborator billing through their workspace can use it even on a free personal profile. Do not confuse that with `404 AGENCY_NOT_FOUND`, which means the scope is present but the account belongs to no workspace. Both need an API key created at https://preuve.ai (Account → API Keys; shown once at creation), except an OAuth connection (the claude.ai connector, Cursor, Claude Code, Codex or any other client with MCP OAuth), which signs in and gets its key at a consent screen. `export_analysis` takes `verbosity`: `summary` keeps every scored field, the Bottom Line narrative (`details.verdict.narrative`), and the closing verdict (`details.sections.synthesis`). It drops the other section prose and Trends data points, and on the largest reports shortens raw evidence and other long text, never a score or a rating, so the export fits one tool result. It defaults to `full` in both workspaces, so pass `summary` unless you need the prose. **Remote (preferred, no file to install):** ```sh claude mcp add preuve --transport http https://mcp.preuve.ai/mcp ``` Then type `/mcp`, pick `preuve` and sign in with Preuve in the browser it opens. There is no key to paste. With a key instead, add `--header "Authorization: Bearer prv_..."`. In Codex, `codex mcp add preuve --url https://mcp.preuve.ai/mcp`, then `codex mcp login preuve` opens the same sign-in. Claude Desktop: add to its MCP config: ```json { "mcpServers": { "preuve": { "url": "https://mcp.preuve.ai/mcp", "headers": { "Authorization": "Bearer prv_..." } } } } ``` In claude.ai (web/desktop), add a custom connector pointing at `https://mcp.preuve.ai/mcp` instead. OAuth sign-in and a consent screen replace manual key handling. In Cursor, add `https://mcp.preuve.ai/mcp` to `mcp.json` with no header. Cursor opens the same sign-in and consent screen, so there is no key to paste. If the Preuve tools are already listed in this session, setup is done. **Stdio-only clients:** bridge with `npx -y mcp-remote https://mcp.preuve.ai/mcp --header "Authorization: Bearer prv_..."`. The native stdio server (`scripts/preuve-mcp-server.mjs`) still works if you have this repo. If tools return 401s, the key is wrong or revoked. Nothing in this skill fixes auth. One remote-only caveat: an `enrich_analysis` call that starts `founderFit` may time out at ~95s while generation continues server-side; the money is safe (the run is locked), poll `get_analysis` until the module reads `completed`. ## The three rules 1. **`scanType: "starter"` is the default, always.** `"deep"` spends a paid scan/token from the account's quota. Only send `"deep"` when the user explicitly asked for a deep/full/paid analysis. If in doubt, ask them first. There is no undo. A deep scan also **requires `stage` and `budget`** (except with `workspace: "agency"`): ask the user for both before calling, never guess them: `stage` is one of `idea | validation | mvp | launched | growth | scaling`, `budget` one of `bootstrap | 10k | 50k | 100k | 100kPlus | 1mPlus`. The tool refuses a deep scan without them (nothing starts, no quota is spent) and the refusal text tells you what to collect. **`workspace: "agency"` is the exception**: there a client project (`"deep"`, one shared project slot) or a client Starter Scan (`"starter"`, no slot, workspace owner only, fair use of 100 per 30 days) takes both fields as optional free text up to 80 characters. Send them only as the client stated them, and start the project without them otherwise. Never hold a client project waiting for context the consultant does not have. Leaving `workspace` out is not that exception: on an account in an Agency workspace a deep scan then starts as a client project there (the response says `workspace: "agency"`, so poll and export with `workspace: "agency"` and the `reportId`), and pass `workspace: "personal"` to keep it on the account's own deep scans. 2. **Nothing is synchronous.** `start_analysis` returns immediately with `status: "PROCESSING"`. Poll `get_analysis` every 20-30 seconds. Analyses typically take a few minutes (deep runs longer); if one is still processing after ~15 minutes, stop polling, hand the user the `reportUrl` so they can watch it land, and offer to check back. The run keeps going server-side. Don't poll in a tight loop. Create/enrich routes are rate-limited (10/min) and there's a daily per-account ceiling. 3. **Export has a gate.** `export_analysis` on a run that isn't `COMPLETED` returns `409 ANALYSIS_NOT_COMPLETE`; completed but `readyForExport: false` returns `409 ENRICHMENT_NOT_COMPLETE`. The fix for the second is always the same: call `enrich_analysis`, poll again, then export. Never treat these 409s as failures. They're sequencing signals. And never export "just to see what's there": the export never returns partial data, a non-ready analysis is always a 409. **One refusal is not a sequencing signal**: `403 REPORT_NOT_FROM_AGENT_RUN` means the report was created on the preuve.ai dashboard rather than by this API. Polling and enriching will never change it, so do not retry. You can see it coming: `get_analysis` returns `exportable: false` with `exportBlockedCode: "REPORT_NOT_FROM_AGENT_RUN"` on such a report, and its `readyForExport` is `false` for that reason rather than because enrichment is pending. `get_analysis` still reports its status. For the data itself, relay the refusal text rather than picking a route yourself: it names the way forward for that specific report, and what is on offer depends on more than the scan depth. Offering a fresh `start_analysis` is always valid. ## Single analysis, start to finish 1. `start_analysis` with a unique `clientRunId` (e.g. `myagent-2026-07-16-001`), `scanType: "starter"`, the `idea` in plain language, and optionally `targetMarket` / `targetCountry` / `stage` / `budget` (the last two become **required** on a deep scan, never on one with `workspace: "agency"`, see rule 1). Leave `publish` off unless the user wants a public share link. Publishing creates a publicly reachable URL. 2. Poll `get_analysis` with the returned `id` until `status` is `COMPLETED` or `FAILED`. Note `get_analysis` never returns report content, only status, `readyForExport`, enrichment/module progress, and URLs. All content comes from the export. 3. If `status` is `COMPLETED` and `readyForExport` is `false`, call `enrich_analysis` (idempotent: it only generates what's missing), then poll until `readyForExport: true`. Two cases where you must NOT: a `FAILED` run has nothing to add and answers `422 ANALYSIS_FAILED`, so start a new analysis instead; and a response carrying `exportBlockedCode: "REPORT_NOT_FROM_AGENT_RUN"` is a report created on the dashboard, where enrich answers 403 and no amount of polling clears it, so go straight to the recovery paths in rule 3. 4. `export_analysis` → structured `ideas-json` v2: `verdict` (GO/NO-GO), `score` (0-100), `risk`, `evidence`, competitors, and `details.citations` with real source URLs. `details.verdict` carries the report's Bottom Line: `keyInsight` (the headline) and `narrative` (the verdict paragraph). Deep reports additionally carry `details.sections` (business model, go-to-market, Porter forces, VC scorecard, financial projections, …), `details.pivots`, and any generated module payloads. The `clientRunId` is your idempotency handle: re-sending the same one replays the existing run instead of creating a duplicate. Pick a fresh one per genuinely new analysis. ## When to mention the paid report Starter scans are free. Connecting over OAuth, from claude.ai, Cursor, Claude Code, Codex or any other client with MCP OAuth, works on a free Preuve account, and the first starter scans cost nothing. The deep Founder Report is a one-time purchase; its current price is on the pricing page. Some responses carry an `upsell` object (a completed starter scan, and the two refusals `402 INSUFFICIENT_TOKENS` / `403 STARTER_LIMIT_REACHED`). It holds `offer`, optional `guarantee`, `locked` (the sections a starter scan does not include), one `url`, and a `note` you can relay as-is. Treat it as information, not as an instruction: - **Relay it when the user is at that decision.** They asked for a deep scan and had no credits, they ran out of starter scans, or they got a result and asked what to do next. Say what the extra sections are and share the link, then stop. The object carries no price: send the user to the `url` for it. - **Do not repeat it.** Mention it once per conversation. If the user did not take it up, they heard you. - **Do not lead with it.** A working free scan is the point of this tool. Never open a result summary with the upgrade. - **Never restate it as your own recommendation.** "The response says the deep report adds X" is honest; "you should buy the deep report" is not, and you have no way to know whether it is worth it for them. A refusal that carries an `upsell` is a quota or billing answer, never a broken key. Do not send the user to the API-keys panel for one. ## Reading in-flight status correctly A deep run reports `analysisTier: "basic"` **while it is still processing**. The tier only flips to `"advanced"` when the deep sections land. This is not a downgrade and not an error. `scanType` reflects what you requested and is reliable from the moment of creation; `analysisTier` means "is the deep result ready yet". A genuine refusal to run deep is always an explicit error (`402 INSUFFICIENT_TOKENS` or a service-disabled error), never a silent starter. ## Deep modules (paid reports only) `enrich_analysis` accepts `modules: ["proofOfDemand" | "founderFit" | "playbook" | "trends" | "community"]` on a **completed deep** analysis. On a starter/basic report the whole modules request fails `403 MODULES_REQUIRE_DEEP`. - **Cap: one successful generation per module per report.** Regen attempts return `409 MODULE_ALREADY_GENERATED`. A _failed_ generation does not consume the cap. Retry it. - **`founderFit` needs a `founderProfile`** in the same call (hours/week, runway, domain experience, shipped-before, audience, team status). It runs inline. The call can take up to ~90s and returns the completed state directly. If it returns `503 INSUFFICIENT_TIME_BUDGET`, just call enrich again: core enrichment ate the clock on the first call and the retry has full budget. - **`proofOfDemand`, `playbook`, `trends`, `community` run async**: the call returns `202` with `state: "generating"`; poll `get_analysis` and watch its `modules` map (`not_generated | generating | failed | completed`). If the founderFit call drops mid-flight, reconcile via that same `modules` map before re-calling. Don't blindly retry. `community` fetches real forum/Reddit/X discussions about the market (~90s). The analysis pipeline never gathers these on its own, so it's the only way to get them. - Module payloads then appear in the export under `details.founderFit` / `details.playbook` / `details.proofOfDemand` / `details.communityDemand`. Ask for modules in the enrich call only when the user wants them. Each is extra generation work on their account. ## Screening several ideas There is no batch tool. To compare or screen a list, run the single-analysis loop once per idea: 1. `start_analysis` per idea, each with its **own unique** `clientRunId`. Keep everything `"starter"` unless deep is intentional per idea, and every deep run must carry `stage` and `budget`. 2. Poll each `get_analysis` until terminal. A completed run with `readyForExport: false` needs `enrich_analysis` on its own run id, unless it also carries `exportBlockedCode: "REPORT_NOT_FROM_AGENT_RUN"` (see rule 3). 3. `export_analysis` each completed run, then rank them yourself. The account holds 3 starter and 2 deep analyses in flight at a time. Past that, `start_analysis` returns `429 CONCURRENT_LIMIT_REACHED`. That is pacing, not failure: wait for a run to finish, then retry that idea with the **same** `clientRunId`. Tell the user which ideas you did not manage to score. A ranking that silently covers 7 of 10 ideas misleads them. ## Errors and retries Every tool error returns the API's JSON error payload as text (never a crash). React by `code`: | Code / status | Meaning | What to do | | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `401` | Missing, malformed, unknown or revoked key | Not retryable from the agent side; tell the user to check their API key | | `402 INSUFFICIENT_TOKENS` | Deep scan requested, no quota | Tell the user; offer a starter scan instead | | `403 MODULES_REQUIRE_DEEP` | Modules on a non-deep report | Only offer modules on deep runs | | `403 REPORT_NOT_FROM_AGENT_RUN` | Export/enrich of a report created on the dashboard, not by this API | Do NOT retry or poll; nothing changes it. The poll still works, so report its status. For the data, relay the refusal text: it names the way forward for that report. A fresh `start_analysis` always works. Not a key or scope problem | | `409 ANALYSIS_NOT_COMPLETE` / `ENRICHMENT_NOT_COMPLETE` | Sequencing, not failure | Poll / enrich, then retry the export | | `409 MODULE_ALREADY_GENERATED` | Module cap hit | The payload already exists. Just export | | `409 CLIENT_RUN_ID_CONFLICT` | The id already belongs to a run in the OTHER workspace; one `clientRunId` namespace covers both on a key | The run is not lost, and the 409 hands you its id (`conflictingRunId`, or the client `reportId`). READ it with `get_analysis` on that id, plus `workspace: "agency"` if it is a client report. Do NOT rebuild a start body from the 409: you would have to invent an `idea`, and the only one in hand is the other workspace's, which a run that failed before dispatching would then re-run under the original id. To genuinely re-run a failed personal scan, resend YOUR original request for that `clientRunId`, unchanged. For the work you were actually starting, take a NEW `clientRunId` | | `422 ANALYSIS_FAILED` | The run itself failed | See retry rule below | | `429 CONCURRENT_LIMIT_REACHED` | Too many analyses in flight for this account | Wait for in-flight runs to finish, then retry the same `clientRunId` | | `429 DAILY_LIMIT_REACHED` | Per-account daily run ceiling | Retry after `resetAt`; polling/export still work | | `429` (route limiter) | >10 creates/min | Back off; slow the loop | **Retry rule for failed runs:** a `FAILED` run that never attached a report (pre-dispatch failures like `RATE_LIMITED`, `INSUFFICIENT_TOKENS`, `TRIGGER_DISPATCH_FAILED`) is retryable. Re-send the **same** `clientRunId` and the run resets and re-dispatches, with anything it claimed already refunded. Runs that did attach a report are strictly idempotent: the same `clientRunId` always returns the stored outcome, so a new attempt needs a new id. Never reach for a fresh `clientRunId` first. Replay the original one, because a fresh id starts, and can bill, a second run. ## Reporting results to the user - Lead with `verdict` and `score`, then the top risk and the evidence quote. That's the analysis's own summary hierarchy. - Always give the `reportUrl` (the user's authenticated report view). Only surface `shareUrl` if one exists or the user asked to publish. - On starter exports, deep-only fields (`details.sections`, `details.pivots`, module payloads) are `null` by design. Don't present that as missing data; mention a deep scan unlocks them if relevant. - Cite from `details.citations` when the user asks "based on what?". Every entry is a real research source with a URL. - Check `idea.inferredContext`: when the user's idea description was short, the analysis filled in assumptions (pricing, delivery model, target segment) and the numbers depend on them. If it's non-null, surface those assumptions to the user. A wrong guess means they should refine the idea text and run a fresh analysis. ```` > [!NOTE] > > The skill is a static document. It carries no credentials and makes no calls itself. Auth still > comes from the single `PREUVE_API_KEY` environment variable on the [MCP server](/mcp-server). ## Other agent frameworks The skill body is plain Markdown. For agents that don't support Claude Code skills, drop the same content wherever your framework accepts standing instructions (a system prompt include, a `AGENTS.md` / `.cursorrules` section, a RAG document). Everything below the frontmatter works standalone. # Export a client report Source: https://docs.preuve.ai/api-reference/agency/export-a-client-report /api-reference/openapi.yaml get /api/agent/agency/reports/{id}/export Structured JSON for one COMPLETED client report, or the same envelope rendered as Markdown with format=markdown. Starter and refunded reports keep their normal content restrictions, named under locked. The report webhook (see the Webhooks guide) hands out both URLs. # Get the Agency workspace Source: https://docs.preuve.ai/api-reference/agency/get-the-agency-workspace /api-reference/openapi.yaml get /api/agent/agency Workspace identity, the caller's role, remaining shared project quota, and one page of the workspace's client reports - dashboard-created ones included, newest first, without report bodies. Consultant and AppSumo Agency accounts only: a key whose account holds no Agency workspace, or whose membership was removed, gets 404 AGENCY_NOT_FOUND on the next call. Membership is resolved live on every request, independently of the key. # List client reports Source: https://docs.preuve.ai/api-reference/agency/list-client-reports /api-reference/openapi.yaml get /api/agent/agency/reports Every client report in the workspace, newest first - including reports created in the Agency dashboard rather than through this API. Paginated with limit/offset; nextOffset is null on the last page. # Poll a client report Source: https://docs.preuve.ai/api-reference/agency/poll-a-client-report /api-reference/openapi.yaml get /api/agent/agency/reports/{id} Status, tier, and report URL for one client report in the workspace. Does not return the report payload - use the export. # Start a client project Source: https://docs.preuve.ai/api-reference/agency/start-a-client-project /api-reference/openapi.yaml post /api/agent/agency/analyses Create one client report. scanType "deep" (the default) spends one shared Agency project credit and never falls back to personal credits. scanType "starter" runs a client Starter Scan that spends no credit: it is open to the workspace owner who holds the AppSumo Tier 4 licence, under the one fair-use ceiling of 100 Starter Scans per 30 days that the personal app and the Agency dashboard share (429 FAIR_USE_LIMIT past it), and to the owner of a workspace nobody has funded yet, for its one free client scan (409 FREE_SCAN_USED once spent). A Starter Scan shows in the Agency dashboard and in the report list like any client report, and its export answers the starter shape, with the deep-only fields listed under locked. Async: 202 on a new dispatch, 200 with reused=true when the clientRunId replays an existing report. clientRunId is scoped to the calling key; reusing one that belongs to a different workspace is 409 CLIENT_RUN_ID_CONFLICT. A response carrying dispatchPending=true means the dispatch outcome is unknown - retry the same clientRunId and arguments after 60 seconds; recovery reuses the original report and credit. 503 TRIGGER_DISPATCH_FAILED is a definite rejection: the credit was restored and that request stays failed on replay, so a new attempt needs a new clientRunId. Creating a report here does not email the client or publish a share link. # Enrich an analysis Source: https://docs.preuve.ai/api-reference/analyses/enrich-an-analysis /api-reference/openapi.yaml post /api/agent/analyses/{id}/enrich Idempotently generates the missing core export sections for a COMPLETED run THIS API started. A report created on the preuve.ai dashboard is refused with 403 REPORT_NOT_FROM_AGENT_RUN, like the export: polling resolves it, generating against it does not. Optionally starts deep-only modules via body.modules (one successful generation per module per report). founderFit runs inline and underwrites against the founder profile saved on preuve.ai when founderProfile is omitted (an explicit payload overrides it); the other modules run async - poll get_analysis. Partial failures return HTTP 207 with a success-shaped body. # Export an analysis (ideas-json) Source: https://docs.preuve.ai/api-reference/analyses/export-an-analysis-ideas-json /api-reference/openapi.yaml get /api/agent/analyses/{id}/export Structured JSON export (schemaVersion 2) for one COMPLETED, export-ready analysis THIS API started. Deep runs include full sections, pivots, citations, and generated module payloads. A report created on the preuve.ai dashboard is not exportable here and answers 403 REPORT_NOT_FROM_AGENT_RUN: the poll resolves it, but the data is served elsewhere. Which way forward depends on the report - Build with AI on its report page where it is available, unlocking or re-running it otherwise - and the refusal text names the right one, so relay that rather than deriving it from the scan depth. Starting a fresh analysis here always works. # Poll an analysis Source: https://docs.preuve.ai/api-reference/analyses/poll-an-analysis /api-reference/openapi.yaml get /api/agent/analyses/{id} Returns run status, readyForExport, enrichment progress, per-module statuses (deep runs), and report/share URLs. Accepts the run id or the report id; any personal starter or deep report the key's account owns resolves, including ones created on the preuve.ai dashboard (their analysis id is the report id, clientRunId is null). Agency client reports are outside that fallback - read those with workspace agency - and so are legacy roast reports, which answer 404. That wider reach is specific to this route, because it returns status rather than payload: export and enrich answer 403 REPORT_NOT_FROM_AGENT_RUN for a dashboard report, and such a response carries exportable false with the reason. Does not return the report payload: use export, on an analysis this API started. # Start an analysis Source: https://docs.preuve.ai/api-reference/analyses/start-an-analysis /api-reference/openapi.yaml post /api/agent/analyses Create one analysis run. Async - poll with GET /api/agent/analyses/{id}. scanType is required and explicit: "starter" costs nothing, "deep" consumes paid account quota. clientRunId is your idempotency key: re-POSTing the same value replays the existing run. Without workspace, a deep scan (not publish) from a key with agency:write whose account is a member of an Agency workspace that can run scans, and is not in Personal mode, starts as a client project in that workspace instead: the response then carries workspace "agency" and a workspaceNote, has the Agency report shape (reportId, no run id), and is polled with GET /api/agent/agency/reports/{reportId}. Send workspace "personal" to keep the scan on the account's own deep scans. A clientRunId already used keeps its original workspace. # Export a batch (ideas-json) Source: https://docs.preuve.ai/api-reference/batches/export-a-batch-ideas-json /api-reference/openapi.yaml get /api/agent/analysis-batches/{batchId}/export Structured export for a batch. Includes only completed, export-ready items; every skipped item is listed in omittedItems with a reason. A single exportedAt is pinned per export so the same batch state always serializes identically. # Poll a batch Source: https://docs.preuve.ai/api-reference/batches/poll-a-batch /api-reference/openapi.yaml get /api/agent/analysis-batches/{batchId} Batch state with one AnalysisRun per item. Item statuses are reconciled on every read, so a creation-time FAILED that was really a lost dispatch response heals here. # Start a batch Source: https://docs.preuve.ai/api-reference/batches/start-a-batch /api-reference/openapi.yaml post /api/agent/analysis-batches Create up to 5 analysis runs in one batch. Idempotent on the batch clientRunId. Each item needs its own unique clientRunId. Item scanType is optional and falls back to the batch's, so set it per item only to mix starter and deep in one batch. # Discover the API Source: https://docs.preuve.ai/api-reference/discovery/discover-the-api /api-reference/openapi.yaml get /api/agent Unauthenticated discovery document: base URL, where the OpenAPI spec and the docs live, how authentication works, what a call costs, the rate limits and the full endpoint list. Read this first when you know nothing else about the API. # Introduction Source: https://docs.preuve.ai/api-reference/introduction Thirteen endpoints: create, poll, enrich, export, idea generation, and Agency client work. Base URL: `https://preuve.ai` Every operation below requires an [API key](/authentication) in the `Authorization: Bearer` header and returns JSON. Errors use a stable `{ error, code }` envelope - see [Errors](/errors). Four discovery resources need no key: [`GET /api/agent`](https://preuve.ai/api/agent) describes the API (auth, costs, limits, endpoints), the OpenAPI 3.1 spec is served as [`/openapi.json`](https://preuve.ai/openapi.json) and [`/openapi.yaml`](https://preuve.ai/openapi.yaml), and the [RFC 9727 catalog](https://preuve.ai/.well-known/api-catalog) links them together. Getting in costs nothing: connecting the [MCP server](/mcp-server) mints a key over OAuth on a free account, and `scanType: "starter"` runs on the same endpoints for free, so it doubles as the sandbox. Creating a key by hand needs a paid personal plan or membership of a Consultant or Agency workspace with an active subscription or a one-time unlock - see [Authentication](/authentication). > [!WARNING] > > The interactive playground makes real calls once you paste your key - a `deep` scan sent from > these pages spends real quota. Use `scanType: "starter"` to explore. ## Endpoints | Endpoint | Method | Purpose | | - | - | - | | `/api/agent/analyses` | POST | Start one analysis | | `/api/agent/analyses/{id}` | GET | Poll one analysis | | `/api/agent/analyses/{id}/enrich` | POST | Generate missing core sections + opt-in deep modules | | `/api/agent/analyses/{id}/export` | GET | Export one completed analysis (`ideas-json`) | | `/api/agent/analysis-batches` | POST | Start a batch (up to 5 items) | | `/api/agent/analysis-batches/{batchId}` | GET | Poll a batch | | `/api/agent/analysis-batches/{batchId}/export` | GET | Export a completed batch | | `/api/agent/tools/idea-generator` | POST | Generate startup ideas from interests | Five more reach a Consultant or Agency **workspace** rather than the calling account, and each needs one of the two Agency scopes, which are never granted implicitly. See [Agency client projects](/mcp-server#agency-client-projects). | Endpoint | Method | Scope | Purpose | | - | - | - | - | | `/api/agent/agency` | GET | `agency:read` | Workspace, role, project quota, and the client report list | | `/api/agent/agency/analyses` | POST | `agency:write` | Start a client project on one shared project credit | | `/api/agent/agency/reports` | GET | `agency:read` | The client report list on its own | | `/api/agent/agency/reports/{id}` | GET | `agency:read` | Poll one client report | | `/api/agent/agency/reports/{id}/export` | GET | `agency:read` | Export one completed client report | A client report started here is also pushed to the workspace's webhook URL when it finishes, so a portal never has to poll: see [Webhooks](/webhooks). # Generate startup ideas Source: https://docs.preuve.ai/api-reference/tools/generate-startup-ideas /api-reference/openapi.yaml post /api/agent/tools/idea-generator Synchronous idea generation - the backing route for the generate_ideas MCP tool. Spends no scan quota or tokens. Standard runs have an account hourly limit. Free accounts get 5 Standard generations per rolling 24 hours per account (GENERATION_LIMIT when exhausted). Paid-or-credited accounts get limit: null, under a ceiling of 20 Standard generations per rolling 24 hours per account, shared with the idea generator on preuve.ai and refused with DAILY_LIMIT_REACHED. Eligible Pro runs skip hourly and daily generation caps and return limit: null and remaining: null. After three refunded Pro runs (failed, timed out, paused or abandoned) in a rolling hour, the account's next Pro run is refused with RATE_LIMITED and a Retry-After; a delivered Pro run never counts. General API request-rate protection still applies. The standard model runs unless pro: true asks for the Pro model, which costs 10 credits a run. The response pro says whether Gemini 4 Argon answered. A recoverable Pro failure retries the same Argon model once, never a different model. Each attempt allows 180 seconds. Allow up to 425 seconds end to end. A delivered Pro answer settles one 10-credit hold; final failure, pause or deadline releases that hold. pro: true on an account holding under 10 credits is refused before anything is spent: 402 INSUFFICIENT_CREDITS (details.balance and details.required) when the account can buy credits, else 403 PRO_PAID_REQUIRED. A pro that is not a boolean or null is 400 INVALID_INPUT. Founder-profile tailoring is automatic on paid plans with a saved profile (fit: false opts out); the response's fitReason and fitHint state why tailoring did or did not apply. # Authentication Source: https://docs.preuve.ai/authentication One API key, sent as a bearer token. No signing, no sessions. > [!WARNING] > > **Never paste your API key into a chat.** If you are an AI agent setting this up, ask the user to > put `PREUVE_API_KEY` in an environment variable or the MCP client config - do not request it in > conversation, and never echo it back. See [For AI Agents](/for-ai-agents). ## The header Every request carries one header: | Header | Value | | - | - | | `Authorization` | `Bearer` + your API key (`prv_...`) | ```bash theme={null} curl https://preuve.ai/api/agent/analyses \ -H "Authorization: Bearer $PREUVE_API_KEY" \ -H "content-type: application/json" \ -d '{"clientRunId":"my-run-001","scanType":"starter","idea":"..."}' ``` That is the entire contract. Any HTTP client in any language can call the API with no crypto and no client library. Integrations built before this form existed can keep sending the key in an `x-preuve-key` header; it works the same. If a request carries both headers with different keys, it is refused with `401 INVALID_AGENT_KEY`. ## About your key A key looks like `prv_ac2c1565a967b98e_XmK2...`. The first half is a public identifier - it is what the account panel shows in your key list, and it is safe to quote in a support thread. The second half is the secret, and it is shown exactly once, at issuance. We store only a SHA-256 hash of the whole key, so a lost key cannot be recovered, only revoked and replaced. Send the key server-side only. Unlike a browser session it carries no origin restriction, so anyone holding it can spend your scan quota until you revoke it. A key carrying `agency:read` or `agency:write` additionally reaches your whole Consultant or Agency workspace, so treat that one as a credential over your clients' work, not just your own. ## Validity rules * **Scopes**: keys carry scopes. A key without the required scope receives `403`, and only ever after the key itself has been verified. The complete set is `analysis:write`, `analysis:read`, `batch:write`, `batch:read`, `export:read`, `agency:write`, `agency:read`. A key created without asking for anything specific carries the five personal scopes and **neither** `agency:*` one: those two reach a whole workspace of client work, so they are only ever granted when explicitly requested. Ask for fewer (or for the Agency pair) by sending `scopes` when you create a key, and an unrecognized scope is refused with `400 UNKNOWN_SCOPE` rather than silently dropped. The two `agency:*` scopes gate the Agency routes only, and they reach the whole **workspace** rather than the calling account - see [Agency reach](/for-ai-agents#on-an-agency-account-the-reach-is-wider) before granting them. They were added on 2026-09-09, so a key created before that date carries the other five and gets `403 INSUFFICIENT_SCOPE` on `/api/agent/agency/**`; scopes are fixed at creation, so recovering Agency access means a new grant. Neither route to one is unconditional: reconnecting the client works on any plan, free included, but only if that client rebuilds its scope request from our discovery document rather than replaying a cached one, so check the consent screen lists the Agency permissions before approving - reconnecting revokes the current key either way. Creating a new key by hand with Agency access (on by default in the workspace's [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys)) cannot silently fail, but it needs either a paid personal plan or membership of a Consultant or Agency workspace with an active subscription or a one-time unlock. * **Revocation**: revoking a key from the [account panel](https://preuve.ai/app?settings=apiKeys) or the [workspace dashboard](https://preuve.ai/consultants/dashboard?tab=keys) takes effect on the next request. * **Failed auth** always returns a stable `{ "error", "code" }` JSON envelope - see [Errors](/errors). * **Repeated failures** from one IP are rate limited; successful calls are limited per account instead, shared across every key you hold - see [Quotas and billing](/quotas-and-billing). > [!NOTE] > > The API playground in these docs makes real calls. Paste your key into the authentication field > and "Send" works exactly like curl - including spending quota on a `deep` scan. # Errors Source: https://docs.preuve.ai/errors Every error is a stable JSON envelope with a machine-readable code. All errors - including unexpected server errors - return: ```json theme={null} { "error": "Human-readable message", "code": "MACHINE_READABLE_CODE" } ``` Some errors add context fields (`details`, `limit`, `tokenBalance`, `resetAt`, ...). The `code` values are stable; branch on them, not on messages. > [!WARNING] > > Branch on `code`, never on `error`. The `error` string is prose and it changes: on `402 > INSUFFICIENT_TOKENS` and `403 STARTER_LIMIT_REACHED` for accounts on the free plan it now runs to > a sentence or two and includes a URL. `code` and the HTTP status did not move and will not. ## The `upsell` object `402 INSUFFICIENT_TOKENS` and `403 STARTER_LIMIT_REACHED` may carry an extra `upsell` object. Free accounts receive the `founder_report` offer; a paid, non-regional account with no deep credits may receive a `scan_pack` top-up on `402`. It is additive and optional, absent on batch items, and may be absent at any time, so treat its presence as a bonus, never as a contract: ```json theme={null} { "error": "No deep credits on this account. The Founder Report unlocks ...", "code": "INSUFFICIENT_TOKENS", "tokenBalance": 0, "upsell": { "offer": "founder_report", "guarantee": "14-day satisfaction guarantee", "url": "https://preuve.ai/pricing?src=agent_api&utm_source=agent_api&utm_medium=agent", "locked": ["Market size (TAM/SAM/SOM)", "Up to 15 competitors with funding and weak spots"], "note": "One relay-ready sentence saying the same thing." } } ``` The same object also appears on `GET /api/agent/analyses/:id` when a **starter** scan owned by a free account has finished. `note` is written to be relayed to a human as-is. `guarantee` appears only on `offer: "founder_report"`. It is omitted from `scan_pack` top-ups. `url` is tagged with the door the request came through: `utm_source=agent_api` for direct API-key calls like the one above, `utm_source=mcp` through the hosted MCP server. **An error carrying `upsell` is a quota or billing answer, never a bad key.** If you are an agent, do not send the user to the API-keys panel for one. ## Common codes | HTTP | Code | Meaning | What to do | | - | - | - | - | | 400 | `INVALID_MODULES` | Unknown or malformed `modules` array | Fix the module names | | 400 | `INVALID_FOUNDER_PROFILE` | Missing/invalid `founderProfile` for `founderFit` | Fix the fields listed in `details` | | 400 | `INVALID_WORKSPACE` | `workspace` on `POST /api/agent/analyses` is not `personal` or `agency` | Send `personal` or `agency`, or omit the field | | 400 | `INVALID_ANALYSIS_ID` | Not a UUID (a title, a share slug, a URL) | Use the run id from create or the report id (the UUID in the report URL) | | 401 | (auth codes) | Missing, malformed, unknown or revoked key | Check [Authentication](/authentication) | | 402 | `INSUFFICIENT_TOKENS` | Deep scan with no quota and no tokens | Top up or use `scanType: "starter"` | | 402 | `INSUFFICIENT_CREDITS` | Idea generation with `pro: true` on an account that can buy credits and holds under 10. `details` carries `required`, `balance` and a `hint` to retry without `pro`; nothing was spent | Buy credits on preuve.ai, or omit `pro` for the standard model | | 402 | `PRO_UNAVAILABLE` | ChatGPT app only: idea generation with `pro: true` on an account that cannot run the Pro model now; nothing was spent. Claude, Cursor and other MCP clients get `INSUFFICIENT_CREDITS`, as the direct API does | Omit `pro` for the standard model | | 403 | `PRO_PAID_REQUIRED` | Idea generation with `pro: true` on an account that cannot buy credits | Omit `pro` for the standard model | | 403 | `MODULES_REQUIRE_DEEP` | Modules requested on a non-deep report | Run a deep scan first | | 403 | `STARTER_LIMIT_REACHED` | Starter scan allowance exhausted (free/regional). On a fixed bank, `creditScans` says the account's credits pack is empty too | Wait for reset or run deep | | 429 | `FAIR_USE_LIMIT` | Paid account hit the starter fair-use ceiling | Contact support to lift it | | 404 | `ANALYSIS_NOT_FOUND` | Unknown id, or the run/report belongs to another account. On the poll only, any personal starter or deep report the account owns resolves, dashboard-created ones included; export and enrich answer 403 instead. Agency client reports need `workspace: "agency"` | Check the id | | 403 | `REPORT_NOT_FROM_AGENT_RUN` | Export/enrich of a report created on the dashboard | Poll it with get\_analysis; for its data relay the refusal text, which names the way forward for that report, or start a new analysis here | | 404 | `REPORT_DELETED` | The run's report was deleted from the dashboard | Nothing to poll, enrich or export; create a new run | | 404 | `NOT_FOUND` | No route matches the method and path | Read `details.openapi` or `GET /api/agent` | | 409 | `ANALYSIS_NOT_COMPLETE` | Run still processing | Keep polling | | 409 | `ENRICHMENT_NOT_COMPLETE` | Export requested before enrichment | Call enrich, poll, retry | | 409 | `MODULE_ALREADY_GENERATED` | Per-module cap reached (one success per report) | Read the payload from the export | | 413 | `PAYLOAD_TOO_LARGE` | Body over the size limit | Trim the request | | 422 | `ANALYSIS_FAILED` | The analysis itself failed | Create a new run | | 429 | `RATE_LIMITED` | Per-route rate limit hit | Back off and retry | | 429 | `CONCURRENT_LIMIT_REACHED` | Too many analyses in flight (3 free / 2 deep) | Wait for one to finish, re-POST the same `clientRunId` | | 429 | `DAILY_LIMIT_REACHED` | Rolling 24h ceiling per account, on run creation or paid Standard idea generation (20) | Retry after `resetAt` (frees one slot). Idea generation sends only `limit`, and each slot frees 24h after its generation | | 429 | `REGEN_LIMIT_REACHED` | Founder Fit lifetime cap on this report | No retry - cap is final | | 503 | `INSUFFICIENT_TIME_BUDGET` | Inline module refused to start late in the request | Retry the same enrich call | | 503 | `CREDIT_SPEND_UNAVAILABLE` | Credits could not be checked or spent (`retryable: true`) | Retry; nothing was spent | | 503 | `PRO_CHECK_UNAVAILABLE` | ChatGPT app only: the Pro check could not run (`retryable: true`). Other MCP clients get `CREDIT_SPEND_UNAVAILABLE`, as the direct API does | Retry; nothing was spent | | 503 | `SERVICE_DISABLED` / `GENERATION_DISABLED` / `POD_DISABLED` | Feature temporarily off | Retry later | | 502 | `ENQUEUE_FAILED` | Background dispatch failed | Retry; nothing was consumed | | 500 | `INTERNAL_ERROR` | Unexpected server error | Retry with backoff | ## Retry-After A `429 RATE_LIMITED` carries a `Retry-After` response header: whole seconds until the limiter's window rolls over. Those windows are fixed one-minute buckets, so the number is exact, not an estimate - waiting that long is enough, and retrying sooner is not. ``` HTTP/1.1 429 Too Many Requests Retry-After: 37 ``` The JSON body is unchanged; keep branching on `code`. The quota-shaped 429s (`CONCURRENT_LIMIT_REACHED`, `DAILY_LIMIT_REACHED`, `FAIR_USE_LIMIT`, `REGEN_LIMIT_REACHED`) send no header - they clear on a different clock, and `resetAt` in the body is the field to use where one applies. ## Retired codes These were part of the HMAC request-signing scheme and can no longer be returned as of **2026-07-29**. They are listed so a client that still branches on them knows the branch is dead, not that the docs forgot a code. | Was | Code | Why it is gone | | - | - | - | | 401 | `MISSING_SIGNATURE_HEADERS` | One header now, so the failure is `MISSING_API_KEY` | | 401 | `INVALID_SIGNATURE` / `TIMESTAMP_SKEW` / `INVALID_TIMESTAMP` | Nothing is signed or timestamped | | 409 | `NONCE_REPLAY` | No nonce, so an identical request is simply replayable | An identical request sent twice now succeeds twice. If you relied on `409 NONCE_REPLAY` for idempotency, use `clientRunId` instead - that is the real idempotency key and always was. ## Partial success (207) Enrich returns HTTP `207` with a **success-shaped** body when some sections or modules failed while others succeeded. Inspect `failures` (core sections) and the per-module `modules` map, then retry the failed parts - the route is idempotent and never regenerates what already completed. ## Pro idea generation Pro idea generation retries Gemini 4 Argon once on a recoverable timeout, provider outage or invalid answer. Each attempt allows 180 seconds. Configure MCP clients to allow up to 425 seconds, or 450 seconds for the local stdio transport. A shorter client timeout can disconnect before the API answers. Generation is synchronous and cannot be polled. A delivered Pro answer consumes one 10-credit hold. Final failure, a generation pause or a deadline releases that hold. A disconnected request that cannot release immediately gives the hold back when its eight-minute lease expires. After three refunded Pro runs in a rolling hour (failed, timed out, paused or abandoned), the account's next Pro run answers `429 RATE_LIMITED` with a `Retry-After` header counting down to when the oldest of the three leaves the hour. A delivered Pro run never counts, and Standard runs are not affected. The API never substitutes an older model for a Pro run. Standard generation limits and timeouts are unchanged. # For AI Agents Source: https://docs.preuve.ai/for-ai-agents How agents should read these docs, call the API, and behave with a Preuve key. Guidance rules, retry semantics, and safety. This page is written for the agent itself: if you are an AI agent working with the Preuve Agent API or MCP server, follow these rules. ## Reading these docs programmatically * Every docs page has a Markdown twin: append `.md` to its URL (e.g. `https://docs.preuve.ai/quickstart.md`). * The full docs index lives at [`/llms.txt`](https://docs.preuve.ai/llms.txt); the complete content in one file at [`/llms-full.txt`](https://docs.preuve.ai/llms-full.txt). * This docs site is itself an MCP server: connect `https://docs.preuve.ai/mcp` from any MCP client to search these docs. * The OpenAPI 3.1 spec is served on the API's own domain at [`https://preuve.ai/openapi.json`](https://preuve.ai/openapi.json) (YAML at [`/openapi.yaml`](https://preuve.ai/openapi.yaml), RFC 9727 catalog at [`/.well-known/api-catalog`](https://preuve.ai/.well-known/api-catalog)) and here at [`/api-reference/openapi.yaml`](https://docs.preuve.ai/api-reference/openapi.yaml). Same file, generated from one source. * [`GET https://preuve.ai/api/agent`](https://preuve.ai/api/agent) is the unauthenticated discovery document: auth header, costs, rate limits and every endpoint. Start there when you know nothing else. ## Getting in Start free: connect and run your first starter scans. * **A key costs nothing to obtain.** Connecting the [MCP server](/mcp-server) from any client mints one over OAuth on a free account. Creating one by hand in [Account → API Keys](https://preuve.ai/app?settings=apiKeys) or a workspace's [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys) needs a paid personal plan or membership of a Consultant or Agency workspace with an active subscription or a one-time unlock - see [Authentication](/authentication). * **`scanType: "starter"` is the sandbox.** There is no separate sandbox host or test key: starter runs hit the same endpoints, return the same `{ error, code }` errors and the same response envelope, and cost nothing. What differs is depth, not shape - a starter run reports `modules: null` while polling, and its export omits the deep-only sections (each one is named in the report's `details.omitted`). Explore with `starter`, then switch the one field when the user asks for the full report. ## Agent guidance rules 1. **Prefer the [MCP server](/mcp-server)** when it is connected. Fall back to plain HTTP with an `Authorization: Bearer` header ([HTTP API](/quickstart)) - there is no client library to install. If you can load skills, install the [Agent Skill](/agent-skill) - it encodes everything on this page plus the full workflow. 2. **`scanType` is always an explicit choice.** `"starter"` costs nothing; `"deep"` consumes the user's paid quota. Never run a deep scan the user did not ask for. 3. **Reuse the same `clientRunId` to retry.** Retries never double-spend; a run that already started returns its stored outcome instead of running again. 4. **Poll, don't hammer.** Starter scans complete in about a minute, deep scans in about eight. Poll every 10-30 seconds and back off on `429` - `RATE_LIMITED` and `CONCURRENT_LIMIT_REACHED` are retryable with the same `clientRunId`. 5. **Branch on `code`, not on error messages.** Every error is a stable `{ error, code }` envelope - see [Errors](/errors). 6. **Do not expose secrets in chat.** Never ask the user to paste `PREUVE_API_KEY` into a conversation, and never echo it back. Prefer environment variables or the MCP server config. 7. **Do not pass `publish: true` unless the user explicitly wants a public share link.** Runs are private by default. 8. **Deep modules are capped at one successful generation per module per report.** A `409 MODULE_ALREADY_GENERATED` means the payload already exists - read it from the export instead of retrying. ## What a key can and cannot do A Preuve API key is a scoped analysis credential, not an account login. | Can | Cannot | | - | - | | Create starter and deep analysis runs for the owning account | Log into preuve.ai or read the dashboard | | Poll, enrich, and export runs **it created** | See the owner's **personal** web-app reports | | Start deep modules on its own deep reports | Change plans, buy tokens, or manage billing | | Create public share links (only with explicit `publish`) | Create or revoke API keys | If a key leaks, the user revokes it and no personal report it did not create is exposed. ### On an Agency account the reach is wider Read this before treating a key as a low-value credential. When the owning account belongs to a Consultant or AppSumo Agency workspace, a key carrying an Agency scope also reaches the [Agency workspace calls](/mcp-server#agency-client-projects), and those are scoped to the **workspace**, not to the key. There are two Agency scopes, they are enforced per route, and neither implies the other, so read each row against the scope it names rather than against "has an Agency scope": | Can, and the scope that grants it | Still cannot | | - | - | | **`agency:read`** — list every client report in the workspace, including ones created in the dashboard | Read another workspace's reports | | **`agency:read`** — export any completed client report in full | Email a client or publish a client share | | **`agency:write`** — start client projects against the workspace's **shared** project credits. A deep scan started without `workspace` lands there too; send `workspace: "personal"` to keep it on the account's own deep scans | Manage the workspace, its team, or billing | A read-only key cannot start anything, and a write-only key cannot list, poll or export a single report. Three consequences worth stating plainly: * **Workspace reach is its own grant, and it can be withheld.** `agency:read` covers listing, reading and exporting client reports; `agency:write` starts client projects on the shared credits. Ask for neither and the key is a purely personal credential no matter whose workspace the owner belongs to. The personal scopes (`analysis:*`, `batch:*`, `export:read`) reach nothing in a workspace. * **`agency:read` includes export.** There is no separate export scope on this surface, so a key that can list client reports can also pull any completed one in full. * **Membership is resolved live, per request.** The scope is necessary, not sufficient. Removing someone from the workspace ends their Agency access on their next call even though their personal key stays valid, and suspending the account ends it immediately. > [!WARNING] > > **Keys created before 2026-09-09 cannot reach an Agency workspace.** Until that date these routes > were gated on `analysis:read` / `analysis:write` / `export:read`, so older keys hold only those > five strings and now get `403 INSUFFICIENT_SCOPE` on every `/api/agent/agency/**` call. Scopes are > fixed at creation and are not backfilled, so recovery means a new grant, and each route has a > condition. **Reconnect the client** and approve the Agency permissions: this works on any plan, > free included, but only if that client rebuilds its scope request from our discovery document > rather than replaying a cached one, and an OAuth client renewing through a refresh token will > **not** re-prompt on its own, so the reconnection has to be started by hand. **Or create a new > key** with "Include Agency workspace access" ticked in Account → API Keys, or in the workspace's > [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys) where Workspace access is > on by default: this cannot silently fail, but manual key creation needs either a paid personal > plan or membership of a Consultant or Agency workspace with an active subscription or a one-time > unlock. So on an Agency workspace, revoking a leaked `agency:*` key is urgent in a way it is not on a personal account: until it is revoked it can read client work and spend shared credits. Revoke from [API key settings](https://preuve.ai/app?settings=apiKeys). ## Recommended agent workflow ```text theme={null} 1. start_analysis { clientRunId, scanType: "starter", idea } 2. get_analysis until status = COMPLETED (poll every 10-30s) 3. export_analysis -> ideas-json (scores, verdict, competitors, risks, citations) 4. Only if the user asks for the full report: start_analysis with scanType: "deep", then enrich_analysis (+ modules), then export. ``` Steps 3 and 4 act on runs this API started. `get_analysis` also resolves a report the account created on the preuve.ai dashboard, but exporting or enriching one answers `403 REPORT_NOT_FROM_AGENT_RUN`. Neither the refusal nor the poll is a retry: **relay the refusal text, or the poll's `exportBlockedHint`.** One of them names the way forward for that specific report, which depends on more than the scan depth (tier, refund state and whether the payload is deliverable all decide whether Build with AI is available), so do not derive it yourself from `scanType`. Running the idea again here with `start_analysis` and exporting that run works in every case. # Get started Source: https://docs.preuve.ai/index Market research and competitive intelligence your agent runs before it builds. Know if an idea is worth building before you ship. Preuve gives Cursor, Claude, or Codex a verdict that has to be earned, the real competitors, and the source behind every figure, the same analysis as [preuve.ai](https://preuve.ai). Paste one prompt, or run one command. Starter scans are free. **1. Get access** Two doors, and only one of them puts a key in your hands. **Connector (OAuth).** Add `https://mcp.preuve.ai/mcp` as a connector in claude.ai, to Cursor, Claude Code or Codex with no header, or to any MCP client that signs you in over OAuth. This works on a free account: Preuve mints the key and installs it in the client for you, so there is nothing to copy or store. Starter scans cost nothing, a deep scan still spends paid quota. Skip straight to the **claude.ai**, **Cursor**, **Claude Code** or **Codex** tab in step 2, and revoke the connection anytime from [API key settings](https://preuve.ai/app?settings=apiKeys). **Manual key.** The header-based setups below (the "Already have a key?" variants, `mcp-remote`) and [direct HTTP calls](/quickstart) need a key you hold yourself. Create one at [Account → API Keys](https://preuve.ai/app?settings=apiKeys) or, in a Consultant or Agency workspace, at [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys). Either works on a paid personal plan or in a Consultant or Agency workspace with an active subscription or a one-time unlock. It is the only path that shows you a `prv_...` value, so copy it when it appears, it's shown once. ```bash theme={null} export PREUVE_API_KEY=prv_... ``` **2. Connect** One connection, then your agent can score ideas in the chat. The **claude.ai**, **Cursor**, **Claude Code** and **Codex** tabs are the no-key path, and so is **Other clients** for any client with MCP OAuth. The rest send your `prv_...` key as a header, so keep it out of the chat. > [tab] Your agent > > No key yet? In Cursor, claude.ai, Claude Code or Codex, use their tab instead, or add the server URL with no header in any other client with MCP OAuth: they sign you in, on a free account too. With a manually created key, paste this as-is. The agent will tell you where to put it. > > ```text theme={null} > I want to validate startup ideas with Preuve: viability score, competitors, source-linked evidence. > > Add the Preuve MCP server. > > 1. I have a Preuve API key (prv_...) from https://preuve.ai/app?settings=apiKeys. > Use it even where the client offers sign-in, so the scopes I chose > carry over. Do NOT ask me to paste the key into chat. Put it in > MCP config / env. > > 2. Add the remote server at https://mcp.preuve.ai/mcp (HTTP): > - Claude Code: > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer " > - Cursor: ~/.cursor/mcp.json: > { "mcpServers": { "preuve": { "url": "https://mcp.preuve.ai/mcp", > "headers": { "Authorization": "Bearer " } } } } > - Claude Desktop config: > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp", > "headers": { "Authorization": "Bearer " } > } > } > } > - Codex: > export PREUVE_API_KEY= > codex mcp add preuve --url https://mcp.preuve.ai/mcp \ > --bearer-token-env-var PREUVE_API_KEY > - Clients that only support stdio: > npx -y mcp-remote https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer " > > 3. Confirm these 5 tools appear: start_analysis, get_analysis, > enrich_analysis, export_analysis, generate_ideas. A sixth, get_agency, is > listed for client work on a Consultant or Agency workspace, which is also > what workspace: "agency" on start_analysis, get_analysis and > export_analysis acts on — 6 tools in total. They are advertised > to every client, so seeing get_agency on a personal account is normal. Two > different refusals, and they mean opposite things: 403 INSUFFICIENT_SCOPE > means the KEY lacks the one scope that call needs — agency:write to start a > client analysis, agency:read for get_agency and the other two agency > calls, enforced per route so neither implies the other (every key > created before 2026-09-09 holds > neither, and scopes cannot be widened after creation — reconnect the > connector, which works on any plan but only if that client rebuilds its > scope request from our discovery document rather than replaying a cached > one, so check the consent screen lists the Agency permissions before > approving; or make a new key with Agency access ticked, which needs a paid > personal plan or a subscribed or unlocked Consultant or Agency workspace), while 404 > AGENCY_NOT_FOUND means the key has the scope but the ACCOUNT belongs to no > Consultant or Agency workspace. There are also two prompts, validate_idea and generate_ideas, > that you can pick from the client. > > 4. First test with scanType "starter" only (it costs nothing): > start_analysis on my idea, poll get_analysis, show me the viability score. > > Read https://docs.preuve.ai/agent-skill.md first. > ``` > [tab] Claude Code > > ```bash theme={null} > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp > ``` > > Then type `/mcp` in Claude Code, pick `preuve` and sign in with Preuve in the browser it opens. Approve, and Preuve creates a key for Claude Code, on any plan including free. No key to copy. > > Already have a key? Send it instead: > > ```bash theme={null} > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer $PREUVE_API_KEY" > ``` > [tab] Cursor > > Add this to `~/.cursor/mcp.json` (or the project `.cursor/mcp.json`): > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp" > } > } > } > ``` > > Cursor opens Preuve sign-in the first time it connects. Approve, and Preuve creates a key for Cursor, on any plan including free. No key to copy. Revoke it anytime from [API key settings](https://preuve.ai/app?settings=apiKeys). > > Already have a key? Send it instead, and Cursor skips the sign-in: > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp", > "headers": { > "Authorization": "Bearer prv_..." > } > } > } > } > ``` > [tab] Codex > > ```bash theme={null} > codex mcp add preuve --url https://mcp.preuve.ai/mcp > codex mcp login preuve > ``` > > The login opens Preuve sign-in in your browser. Approve, and Preuve creates a key for Codex, on any plan including free. > > Already have a key? Save it in `PREUVE_API_KEY`, then: > > ```bash theme={null} > codex mcp add preuve \ > --url https://mcp.preuve.ai/mcp \ > --bearer-token-env-var PREUVE_API_KEY > ``` > [tab] claude.ai > > In claude.ai (web or desktop): **Settings → Connectors → Add custom connector**. Paste: > > ```text theme={null} > https://mcp.preuve.ai/mcp > ``` > > Sign in with Preuve and approve. Works on a free account. There is no key to copy: Preuve mints one for the connector and installs it, and the value is never shown. Revoke it anytime from [API key settings](https://preuve.ai/app?settings=apiKeys). > [tab] Other clients > > If your client supports MCP OAuth, add `https://mcp.preuve.ai/mcp` with no header and sign in with Preuve, on a free account too. No key to copy. > > If your client cannot use a remote HTTP MCP server, bridge with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote): > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "command": "npx", > "args": [ > "-y", > "mcp-remote", > "https://mcp.preuve.ai/mcp", > "--header", > "Authorization: Bearer prv_..." > ] > } > } > } > ``` Tool list and extra install options: [MCP server](/mcp-server). **3. Get a score** Ask. A starter scan is free and usually done in 1-3 minutes. ```text theme={null} Validate this idea with a starter scan: "AI bookkeeping for solo lawyers in France" ``` A deep scan spends your paid quota. Ask for one only when you want the full report. ## Next steps > [card] [MCP tools](/mcp-server) > > Score, enrich, and export an idea from the chat. > [card] [Agent Skill](/agent-skill) > > Same validation, without your agent spending a paid scan by accident. > [card] [HTTP API](/quickstart) > > Same verdict, as JSON, from your own code. > [card] [Quotas](/quotas-and-billing) > > Starter is free. Deep uses the same quota as the web app. # MCP Server Source: https://docs.preuve.ai/mcp-server A verdict that has to be earned, real competitors, and their sources, in the chat you are already in. Score an idea without leaving Cursor, Claude, or Codex. Same analysis as [preuve.ai](https://preuve.ai): the score and verdict, real competitors, source-linked evidence. ```text theme={null} https://mcp.preuve.ai/mcp ``` Same key as [Get started](/). In claude.ai, Cursor, Claude Code, Codex and any other client with MCP OAuth, connecting signs you in and mints the key for you, which works on a free account. Start free: connect and run your first starter scans. A client that only takes a header needs one created by hand at [Account → API Keys](https://preuve.ai/app?settings=apiKeys) or, in a Consultant or Agency workspace, at [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys). Either works on a paid personal plan or in a Consultant or Agency workspace with an active subscription or a one-time unlock. A key made either way covers the five personal tools. [Agency client projects](#agency-client-projects) need two extra scopes that are never granted implicitly: tick **Include Agency workspace access** when creating the key by hand in Account → API Keys (in a workspace's [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys), Workspace access is on by default), or approve the Agency permissions on the consent screen when you sign in. ## Connect > [tab] Your agent > > No key yet? In Cursor, claude.ai, Claude Code or Codex, use their tab instead, or add the server URL with no header in any other client with MCP OAuth: they sign you in, on a free account too. With a key, paste this as-is. Keep the key out of the chat. > > ```text theme={null} > I want to validate startup ideas with Preuve: viability score, competitors, source-linked evidence. > > Add the Preuve MCP server. > > 1. I have a Preuve API key (prv_...) from https://preuve.ai/app?settings=apiKeys. > Use it even where the client offers sign-in, so the scopes I chose > carry over. Do NOT ask me to paste the key into chat. Put it in > MCP config / env. > > 2. Add the remote server at https://mcp.preuve.ai/mcp (HTTP): > - Claude Code: > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer " > - Cursor: ~/.cursor/mcp.json: > { "mcpServers": { "preuve": { "url": "https://mcp.preuve.ai/mcp", > "headers": { "Authorization": "Bearer " } } } } > - Claude Desktop config: > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp", > "headers": { "Authorization": "Bearer " } > } > } > } > - Codex: > export PREUVE_API_KEY= > codex mcp add preuve --url https://mcp.preuve.ai/mcp \ > --bearer-token-env-var PREUVE_API_KEY > - Clients that only support stdio: > npx -y mcp-remote https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer " > > 3. Confirm the personal tools appear: start_analysis, get_analysis, > enrich_analysis, export_analysis, generate_ideas. A sixth tool, > get_agency, is listed for every account and is not an error. > > 4. First test with scanType "starter" only (it costs nothing): > start_analysis on my idea, poll get_analysis, show me the viability score. > > Read https://docs.preuve.ai/agent-skill.md first. > ``` > [tab] Claude Code > > ```bash theme={null} > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp > ``` > > Then type `/mcp` in Claude Code, pick `preuve` and sign in with Preuve in the browser it opens. Approve, and Preuve creates a key for Claude Code, on any plan including free. No key to copy. > > Already have a key? Send it instead: > > ```bash theme={null} > claude mcp add preuve --transport http https://mcp.preuve.ai/mcp \ > --header "Authorization: Bearer $PREUVE_API_KEY" > ``` > [tab] Cursor > > Add this to `~/.cursor/mcp.json` (or the project `.cursor/mcp.json`): > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp" > } > } > } > ``` > > Cursor opens Preuve sign-in the first time it connects. Approve, and Preuve creates a key for Cursor, on any plan including free. No key to copy. Revoke it anytime from [API key settings](https://preuve.ai/app?settings=apiKeys). > > Already have a key? Send it instead, and Cursor skips the sign-in: > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "url": "https://mcp.preuve.ai/mcp", > "headers": { > "Authorization": "Bearer prv_..." > } > } > } > } > ``` > [tab] Codex > > ```bash theme={null} > codex mcp add preuve --url https://mcp.preuve.ai/mcp > codex mcp login preuve > ``` > > The login opens Preuve sign-in in your browser. Approve, and Preuve creates a key for Codex, on any plan including free. > > Already have a key? Save it in `PREUVE_API_KEY`, then: > > ```bash theme={null} > codex mcp add preuve \ > --url https://mcp.preuve.ai/mcp \ > --bearer-token-env-var PREUVE_API_KEY > ``` > [tab] claude.ai > > In claude.ai (web or desktop): **Settings → Connectors → Add custom connector**. Paste: > > ```text theme={null} > https://mcp.preuve.ai/mcp > ``` > > Sign in with Preuve and approve. No key to copy. Preuve creates one for the connector. Revoke it anytime from [API key settings](https://preuve.ai/app?settings=apiKeys). > [tab] Other clients > > If your client supports MCP OAuth, add `https://mcp.preuve.ai/mcp` with no header and sign in with Preuve, on a free account too. No key to copy. > > If your client cannot use a remote HTTP MCP server, bridge with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote): > > ```json theme={null} > { > "mcpServers": { > "preuve": { > "command": "npx", > "args": [ > "-y", > "mcp-remote", > "https://mcp.preuve.ai/mcp", > "--header", > "Authorization: Bearer prv_..." > ] > } > } > } > ``` > > If you have this repo, you can run the local server instead: > > ```bash theme={null} > claude mcp add preuve \ > --env PREUVE_API_KEY=$PREUVE_API_KEY \ > -- node /path/to/scripts/preuve-mcp-server.mjs > ``` ## Tools | Tool | What it does | | - | - | | `start_analysis` | Start one scan. You must pass `scanType`: `starter` (free) or `deep` (paid). A deep scan also requires `stage` and `budget`, unless you pass `workspace: "agency"`. Without `workspace`, a deep scan from an account in a Consultant or Agency workspace starts as a client project there; pass `workspace: "personal"` to keep it on the account's own deep scans. To screen several ideas, call it once per idea. Optional `workspace`. | | `get_analysis` | Check status, progress, and report URLs. Does not return the result itself. Takes a run id or a report id, and resolves **any personal starter or deep report the account owns**, including ones created on the preuve.ai dashboard. A dashboard one comes back with `exportable: false`. Optional `workspace`. | | `enrich_analysis` | Fill in missing sections. Safe to call twice. Can start extra modules on a deep scan. Like the export, it serves analyses this API started: a dashboard report is refused with `403 REPORT_NOT_FROM_AGENT_RUN`. | | `export_analysis` | Get the JSON result for one completed scan **this API started**. A report created on the dashboard is refused with `403 REPORT_NOT_FROM_AGENT_RUN`; the refusal text names the way forward for that report, which may be Build with AI on its report page or unlocking it there, and running the idea again here with `start_analysis` always works. Optional `verbosity` and `workspace`. There is no `format` parameter: the export is always the same JSON shape. | | `generate_ideas` | Generate startup ideas from interests. Free accounts: 5 per rolling 24 hours. The standard model runs unless `pro: true` asks for the Pro model, which is refused, never downgraded, when the account cannot run it. Founder-profile tailoring is automatic on paid accounts with a saved profile. Spends no scan quota. | | `get_agency` | Read a Consultant or Agency workspace in one call: role, remaining shared project credits, and the client reports already in it, newest first with `nextOffset` for paging. See [Agency client projects](#agency-client-projects). | On a few fields the MCP schema is stricter than the HTTP API, and it validates before the call rather than trimming after it. `idea` must be 40 to 50,000 characters, `targetMarket` at most 180, and `targetCountry`, `stage` and `budget` at most 80. One schema serves both workspaces, so it carries the Agency route's bounds even on a personal scan, where the HTTP route would have accepted a longer value and trimmed it. Size to these limits if you send the same body both ways. ### Agency client projects Consultant and AppSumo Agency accounts reach their workspace through the same tools: `get_agency` reads the workspace, and `workspace: "agency"` on `start_analysis`, `get_analysis` and `export_analysis` acts on it instead of the account's own ideas. `start_analysis` also chooses it for you: with no `workspace`, a deep scan from a key carrying `agency:write`, on an account in an Agency workspace that can run scans and is not in Personal mode, starts as a client project there. The response says `workspace: "agency"` and carries a `workspaceNote`, so poll `get_analysis` and `export_analysis` with `workspace: "agency"` and its `reportId`. Starter scans stay personal, and `workspace: "personal"` keeps a deep scan on the account's own deep scans. These use the same project quota as the Agency dashboard, and they need TWO things, checked in that order: a key carrying the scope that call needs, then live workspace membership. The two Agency scopes are enforced per route and neither implies the other, so a key holding only `agency:read` cannot start a client project and one holding only `agency:write` cannot read the workspace, poll or export a report (see the Scope column below). A key without the scope gets `403 INSUFFICIENT_SCOPE` and never reaches the membership check, which is what every key created before 2026-09-09 receives; a scoped key on an account belonging to no workspace gets `404 AGENCY_NOT_FOUND`. Personal AppSumo Tiers 1-3 continue to use the personal tools above. `enrich_analysis` takes no `workspace`, and client reports never need it: an Agency report is exportable the moment its status is `COMPLETED`. Calling `enrich_analysis` with a client `reportId` reaches the personal route and returns `404`. A client project is always deep, and the `stage` and `budget` rule does not follow it there when you pass `workspace: "agency"`. A deep scan that leaves `workspace` out still needs both, so the tool asks for them before it starts. Both stay optional, and both take free text up to 80 characters rather than the personal vocabulary, because a consultant records what the client said. Send them only as the client stated them, and start the project without them otherwise. All six tools are advertised to every client, with no scope filter. That is deliberate: a personal-only key discovers the Agency door and gets a refusal naming the recovery, instead of "unknown tool" from a list that changed shape between two accounts. The consequence is that a client which keeps making an Agency call on a key without the scope gets `403` every time, indefinitely. Nothing self-heals: the refusal is an answer, not a failure, and it ends when the key is replaced. One ceiling still applies, and it is not a scope ceiling. Every authenticated request passes an attempt limiter that bounds the key lookup itself, so a client looping hard enough to exhaust it receives `429 RATE_LIMITED` instead of the `403`, and the actionable message with it. Waiting clears the `429` and returns the `403`; only a new key clears the `403`. | Call | Scope | What it does | | - | - | - | | `get_agency` | `agency:read` | Your workspace, role, remaining project quota, and the client reports list, dashboard-created ones included. | | `start_analysis` + `workspace: "agency"` | `agency:write` | Create a deep client report using one shared Agency project credit. | | `get_analysis` + `workspace: "agency"` | `agency:read` | Check a client report's status. | | `export_analysis` + `workspace: "agency"` | `agency:read` | Read a completed client report as JSON, with `full` or `summary` verbosity. | Ask your agent: "Check my Agency quota, then run a deep client project for this idea." Starting a project spends Agency quota and never falls back to personal credits. Reuse the same `clientRunId` after a timeout to recover the original report without starting or charging for another one. An uncertain dispatch returns `dispatchPending: true`; retry the same start with the same `clientRunId` after 60 seconds. Recovery uses the original report and credit. After 23 hours, the response directs you to support instead of risking a duplicate job. A definite dispatch rejection restores the credit and returns `TRIGGER_DISPATCH_FAILED`. That failed request stays failed on replay; use a new `clientRunId` only when you intentionally start a new attempt. One `clientRunId` namespace covers both workspaces on a key. An id that already started a client project cannot start a personal scan, or the reverse: it returns `409 CLIENT_RUN_ID_CONFLICT`. Sending a different explicit `workspace` on a start you have already sent needs a new id. Leaving `workspace` out replays the run in the workspace it started in. Reports appear in the Agency dashboard. Creating one through MCP does not email the client or publish a share link. Existing client reports can be read without having been created through MCP. Removing a collaborator's workspace membership removes their Agency access on the next call, even if their personal key remains valid. Starter and refunded reports retain their normal content restrictions. Client sharing, pivots and other dashboard actions remain in the dashboard. ### Keeping exports small `export_analysis` takes `verbosity`: `full` or `summary`. `summary` keeps every scored field: score, verdict (including the Bottom Line narrative under `details.verdict.narrative`), competitors, market size, risks and pivots. One subsection survives the trim: `details.sections.synthesis`, the report's closing verdict (final verdict, key strengths and weaknesses, deal breakers, pivot recommendation). Every summary drops the other section prose but keeps their numbers and short values, and counts Google Trends data points. Everything else stays whole when it fits. On the largest reports the summary then reduces raw evidence and how-to material (forum posts, prospects, the playbook, action plans, sources, citations) to numbers and short text, and cuts the remaining long text to the largest length that fits one tool result (65,000 JSON characters). Numbers, short values, each verdict and the closing verdict are never cut. What it changed is listed under `details.omitted`. `export_analysis` defaults to `full`, in both workspaces. ### Locked fields on a starter scan A starter scan returns a real analysis, not a partial one, but it leaves the deep-tier fields null. A deep scan on the same idea fills in `details.sections` and `details.pivots` directly. Five more, `details.founderFit`, `details.playbook`, `details.googleTrends`, `details.proofOfDemand` and `details.communityDemand`, are opt-in modules: a deep report makes them available, and `enrich_analysis` generates them on request. Competitor detail, risk explanations, market segmentation (`details.market.segments`, `industryTrends`, `competitivePositioning`) and source citations (`details.citations`, `details.searchContext.sources`) are withheld the same way the web report withholds them from a free viewer. When anything is withheld, the export carries a top-level `locked` object naming each field, what unlocks it, and why. Read it before concluding a field is missing: `null` there means locked by tier, not a failed analysis. ## Slash commands The server also exposes two MCP prompts. They are shortcuts for you, not tools the model calls: pick one from your client (in Claude Code they are `/mcp__preuve__validate_idea` and `/mcp__preuve__generate_ideas`; in claude.ai they are under the **+** menu, Connectors). * `validate_idea`, taking the idea as its only argument, drops in a request that runs the scan and polls it to completion. * `generate_ideas`, taking your interests as its only argument, drops in a request that generates startup ideas - no prior report needed. ## Example prompts ```text theme={null} Validate this idea with a starter scan: "AI bookkeeping for solo lawyers in France" Run a deep scan on my top idea, then generate the launch playbook and proof of demand once it completes. Score these 4 ideas with starter scans and rank them by viability score. ``` > [!NOTE] > > A deep scan spends the same quota as the web app. The MCP server does not add a second bill. See > [Quotas and billing](/quotas-and-billing). ## Teach your agent the workflow Your agent can keep scoring ideas without burning a paid scan. The [Agent Skill](/agent-skill) is that judgment: starter vs deep, when to wait, when a retry is safe. Without it, agents often retry with a new id and spend a second deep scan. Install it once. It is a markdown file, not another key. # Deep Modules Source: https://docs.preuve.ai/modules Opt-in analysis modules on paid deep runs: Proof of Demand, Founder Fit, Playbook, Trends, and Community. Deep (paid) analyses can generate five optional modules through the enrich endpoint. Pass `modules` in the body of `POST /api/agent/analyses/:id/enrich`: ```json theme={null} { "modules": ["playbook", "proofOfDemand", "trends", "community"] } ``` | Module | What it generates | Execution | | - | - | - | | `proofOfDemand` | **Beta.** Verified real-demand prospects: real people publicly expressing the pain or asking for the solution, with verbatim quotes. Results can be uneven; every quote links to its source thread | Async | | `founderFit` | Founder-vs-plan underwriting from your `founderProfile`: fit score, top risks, pivot fit | Inline (up to \~90s) | | `playbook` | A concrete launch playbook for the idea | Async | | `trends` | Google Trends data for the idea's keywords, generated on demand (the analysis itself never fetches it) | Async | | `community` | Community signals: real discussions from forums, Reddit, review sites, and X about the idea's market, with links back to each source | Async | ## Rules * **Deep only.** Requesting modules on a free run returns `403 MODULES_REQUIRE_DEEP`. The analysis must be `COMPLETED` (`409 ANALYSIS_NOT_COMPLETE` otherwise). * **One successful generation per module per report.** A module already generated returns `409 MODULE_ALREADY_GENERATED`. A failed generation never consumes the cap - retry freely. * **Async modules** return `202` with `state: "generating"`. Poll `GET /api/agent/analyses/:id`: its `modules` map reports `not_generated | generating | failed | completed` per module. A generation already started elsewhere (for example by the report owner in the web app) returns `202` with `alreadyStarted: true` - the API and the web app can never double-generate. * Generated payloads land in the export as `details.founderFit`, `details.playbook`, and `details.proofOfDemand`, and in the report's web view. ## Founder Fit `founderFit` requires a `founderProfile` in the same request: ```json theme={null} { "modules": ["founderFit"], "founderProfile": { "hoursPerWeek": 20, "runwayMonths": 6, "domainYears": 3, "shippedBefore": "side_project", "audienceSize": "under_1k", "teamStatus": "solo", "twelveMonthGoal": "replace_income", "sabotagePattern": "I rebuild the landing page instead of talking to users" } } ``` | Field | Type | Values | | - | - | - | | `hoursPerWeek` | number | 1-168 | | `runwayMonths` | number | 0-120 | | `domainYears` | number | 0-60 | | `shippedBefore` | enum | `never`, `side_project`, `launched` | | `audienceSize` | enum | `none`, `under_1k`, `1k_10k`, `over_10k` | | `teamStatus` | enum | `solo`, `cofounded_friends`, `cofounded_colleagues`, `team_with_hires` | | `twelveMonthGoal` | enum, optional | `replace_income`, `side_income`, `vc_scale` | | `sabotagePattern` | string, optional | Max 280 chars | A missing or invalid profile returns `400 INVALID_FOUNDER_PROFILE` with per-field `details`. Founder Fit runs inline and returns `state: "completed"` in the same response on success. Two extra guards: * `503 INSUFFICIENT_TIME_BUDGET` (retryable): the request spent too much time on core enrichment first. Call enrich again - core is now done, so the retry has the full time budget. * `429 REGEN_LIMIT_REACHED`: the report's lifetime Founder Fit generation cap (shared with the web app) is exhausted. ## Trends `trends` is on-demand by design: the analysis pipeline never fetches Google Trends itself. Startable when the data is absent or a previous fetch `failed`; successful data is final (`409 MODULE_ALREADY_GENERATED`) - it is never re-fetched for freshness. Once generated, the data lands in the export as `details.googleTrends`: `fetchedAt`, `timeRange`, and per-keyword `{ keyword, averageVolume, growthPercent, peakMonth, dataPoints }`. Values are Google's 0-100 search interest. Google scales each request of up to 5 terms to its own 100, and terms 1-5 and 6-10 come from two requests. Compare `averageVolume` and `dataPoints` only inside one term, never between terms. `growthPercent` compares the last 6 months with the 6 before. It is `null` when the earlier half averages under 10, because there is too little data to measure a change. `peakMonth` is the week label of the highest value, or `null` when every week is 0. ## Community `community` is on-demand by design too: the deep analysis pipeline never generates community signals itself. This module - or the "Analyze Community Signals" button in the web report - is the only way to get them. It takes about 90 seconds and shares its in-flight lock with that button: if a refresh is already running, calling the module returns `202` with `alreadyStarted: true` instead of starting a second one. # HTTP API Source: https://docs.preuve.ai/quickstart Same Preuve verdict, as JSON, from your own code. Score ideas from a script or backend: viability score, competitors, source-linked evidence. One bearer token, no SDK. For Claude, Cursor, or Codex, use [Get started](/) instead. **1. Get your key** Calling the API from your own code needs a key you create yourself. Make one at [Account → API Keys](https://preuve.ai/app?settings=apiKeys) or, in a Consultant or Agency workspace, at [Dashboard → API keys](https://preuve.ai/consultants/dashboard?tab=keys). Either works on a paid personal plan or in a Consultant or Agency workspace with an active subscription or a one-time unlock. The `prv_...` value is shown once. Send it as `Authorization: Bearer prv_...` (see [Authentication](/authentication)). ```bash theme={null} export PREUVE_API_KEY=prv_... ``` > [!WARNING] > > Copy the key when you create it. It's shown once. Keep it out of git and out of browser code. > [!NOTE] > > Connecting the Preuve connector instead works on a free account, but it mints the key inside your > MCP client and never shows you the value, so there is nothing to send as a bearer token. For that > path, start at [Get started](/). **2. Create an analysis** ```bash theme={null} curl https://preuve.ai/api/agent/analyses \ -H "Authorization: Bearer $PREUVE_API_KEY" \ -H "content-type: application/json" \ -d '{ "clientRunId": "my-run-001", "scanType": "starter", "idea": "A scheduling assistant that helps independent coffee shops coordinate weekly local supplier orders with lower waste.", "targetMarket": "Independent coffee shops", "targetCountry": "US" }' ``` > [!NOTE] > > `scanType` is required: `"starter"` is free, `"deep"` spends paid quota. `clientRunId` is how you > retry: sending the same value again returns the existing run instead of starting a second one. > Optional context fields sharpen the report: `stage` (`idea | validation | mvp | launched | growth | scaling`) and `budget` (`bootstrap | 10k | 50k | 100k | 100kPlus | 1mPlus`) feed the feasibility > analysis directly, and the MCP tools make both **required** on a deep scan unless it is an Agency > client project (`workspace: "agency"`), which keeps both optional, as free text. On `POST > /api/agent/analyses`, an optional `workspace` (`personal` or `agency`) decides where a deep scan > runs: leave it out and a key with `agency:write` on an Agency workspace member starts a client > project there, send `personal` to keep the scan on the account's own deep scans. > [!TIP] > > No terminal handy? The same calls run in the browser on the [RapidAPI > playground](https://rapidapi.com/PreuveAI/api/preuve-ai-startup-validation) or from the [Postman > workspace](https://www.postman.com/preuve-ai/preuve-ai-agent-api/overview): paste your `prv_...` > key into the **Authorization** tab. Both listings are free; what you spend is your Preuve quota, > same as from code. > [accordion] Same call in JavaScript > > ```javascript theme={null} > const BASE_URL = process.env.PREUVE_AGENT_BASE_URL || 'https://preuve.ai'; > > export async function preuve(method, path, bodyObject = null) { > const response = await fetch(new URL(path, BASE_URL), { > method, > headers: { > 'content-type': 'application/json', > Authorization: `Bearer ${process.env.PREUVE_API_KEY}`, > }, > body: bodyObject ? JSON.stringify(bodyObject) : undefined, > }); > return response.json(); > } > > const run = await preuve('POST', '/api/agent/analyses', { > clientRunId: 'my-run-001', > scanType: 'starter', > idea: 'A scheduling assistant that helps independent coffee shops coordinate weekly local supplier orders with lower waste.', > targetMarket: 'Independent coffee shops', > targetCountry: 'US', > }); > > console.log(run.id, run.status); > > ``` **3. Poll until complete** ```bash theme={null} curl https://preuve.ai/api/agent/analyses/RUN_ID \ -H "Authorization: Bearer $PREUVE_API_KEY" ``` Starter runs typically complete in 1-3 minutes, deep runs in 5-10. Poll every 10-15 seconds until `status` is `COMPLETED`. **4. Enrich, then export** ```bash theme={null} # if readyForExport is false curl -X POST https://preuve.ai/api/agent/analyses/RUN_ID/enrich \ -H "Authorization: Bearer $PREUVE_API_KEY" \ -H "content-type: application/json" \ -d '{}' curl "https://preuve.ai/api/agent/analyses/RUN_ID/export?format=ideas-json" \ -H "Authorization: Bearer $PREUVE_API_KEY" ``` You get stable JSON (`schemaVersion: 2`): score, verdict, competitors, risks, and citations. Deep scans also include the full report, pivots, and any modules. See [Scans and enrichment](/scans-and-enrichment). ## Next steps > [card] [MCP server](/mcp-server) > > Same verdict, from the chat you are already in. > [card] [Batches](/api-reference/introduction) > > Score up to 5 ideas over HTTP and rank them by viability. > [card] [Deep modules](/modules) > > Proof of Demand, Founder Fit, Playbook, and Trends on demand. > [card] [Quotas and billing](/quotas-and-billing) > > What gets charged, and what gets refunded. # Quotas and Billing Source: https://docs.preuve.ai/quotas-and-billing The API consumes your existing Preuve account quotas. No separate API billing. The Agent API is an access channel, not a separate product: every call draws on the same account balance and quotas as the web app. ## What each call consumes | Call | Consumes | | - | - | | `scanType: "starter"` run | Never charged. Free-tier and regional accounts: one scan from the Starter scan allowance. Paid accounts (Founder, Lifetime, premium): unlimited, under a silent fair-use ceiling | | `scanType: "deep"` run | See the waterfall below | | Enrich (core sections) | Nothing extra - included in the run | | Deep modules | Nothing extra - included in the paid deep report (capped at one successful generation per module) | | Poll / export | Nothing | ## Deep scan quota waterfall A deep run claims quota in this order: 1. **Active subscription** (older monthly plans) - decrements your monthly subscription scan counter. 2. **Lifetime plan** (Lifetime Pro / Business) - decrements your monthly lifetime scan counter (5 or 10 scans/month; plans bought before October 1, 2026 keep 10 or 20). When the monthly counter is exhausted, the run falls back to tokens if you have any. 3. **Tokens** - deducts 1 token from your balance, recorded in the transaction ledger. No quota and no tokens returns `402 INSUFFICIENT_TOKENS` - the run fails before any analysis starts, and nothing is charged. ## Safety nets * **Automatic refunds**: if a run fails before the analysis actually starts (service disabled, dispatch failure, ...), whatever it claimed - token, lifetime scan, subscription scan, Starter scan - is refunded. * **Idempotent retries**: re-POSTing a `clientRunId` whose run failed before dispatch retries it without double-spending. A run that started always returns its stored outcome. * **Explicit `scanType`**: agents cannot spend paid quota by accident; deep is always an explicit choice. * **Failed modules never consume the per-module cap**; only a successful generation does. ## Rate limits | Limiter | Limit | | - | - | | Run creation | 10/min per account | | Concurrency | 3 starter / 2 deep analyses in flight per account (single runs; batches are bounded by size) | | Batch creation | 10/min per account | | Agency creation | 10/min per account (shared with Run creation) **and** 10/min per Agency workspace | | Enrich | 12/min per account + analysis | | Daily ceiling | Rolling 24h cap on run creation per account (`429 DAILY_LIMIT_REACHED`, `limit` field) | Rate limits key on your account, not on the individual API key or the caller IP, so neither rotating IPs nor creating extra keys widens any window - every key on an account draws on one shared budget. Repeated *failed* authentications are the exception: those are throttled per IP, since there is no account to attribute them to. Calls arriving through the [hosted MCP server](/mcp-server) are exempt from the per-IP budgets - every remote MCP user would otherwise share that server's single egress IP - but they are not exempt from the limits above. An MCP connector holds a key on your account like any other, so its runs draw on the same per-minute windows and the same daily ceiling as your direct API calls. A `429 RATE_LIMITED` from any of these limiters carries a `Retry-After` header with the exact number of seconds until the window resets. See [Errors](/errors). # Scans and Enrichment Source: https://docs.preuve.ai/scans-and-enrichment Starter vs deep scans, the async run lifecycle, and what the ideas-json export contains. ## Scan types | | `scanType: "starter"` | `scanType: "deep"` | | - | - | - | | Cost | No charge (Starter scan allowance) | Consumes paid account quota | | Depth | Core viability analysis + score | 15+ sections, pivots, citations, full research | | Typical duration | 1-3 min | 5-10 min | | Export | Summary contract | Summary + `details.sections`, `details.pivots`, module payloads | | Modules | Not available (`403 MODULES_REQUIRE_DEEP`) | Opt-in via [enrich](/modules) | `scanType` is always explicit - there is no default. A refused deep scan is never silently downgraded to starter; it fails loudly (`402 INSUFFICIENT_TOKENS` or a service-disabled error). > [!NOTE] > > While a deep run is still `PROCESSING`, `analysisTier` reads `basic` until the deep sections land. > Use `scanType` (your request) as the in-flight signal and `analysisTier` as "is the deep result > ready yet". ## Run lifecycle ```text theme={null} POST /analyses -> { id, status: PROCESSING } GET /analyses/:id -> PROCESSING ... COMPLETED (or FAILED) POST /analyses/:id/enrich -> generates missing export sections (idempotent) GET /analyses/:id/export -> ideas-json ``` `readyForExport` is separate from `status`: a run can be `COMPLETED` but still need enrichment before export. The enrich route skips whatever already exists, so calling it twice never regenerates or double-spends. One exception: on a report created on the preuve.ai dashboard, `readyForExport` is always `false` and enrichment will not fix it. Those responses also carry `exportable: false` and `exportBlockedCode: "REPORT_NOT_FROM_AGENT_RUN"`. Poll them here. For the data, relay `exportBlockedHint`: it names the way forward for that report, which may be Build with AI on its report page (its build kit holds the whole report as `research/full-report.md`) or, when Build with AI is not available for it, unlocking or re-running it there. Scan depth alone does not decide that, so do not infer it from `scanType`. A fresh deep analysis started here always works. Partial enrichment failures return HTTP `207` with a success-shaped body and a `failures` list - retry by calling enrich again. ## The ideas-json export (schemaVersion 2) Every tier gets the summary contract: * `verdict`, `score`, `risk`, `quote`, `evidence` * `details.verdict` - `{ score, label, narrative, keyInsight, recommendation, confidence }`. `label` carries the same text as `narrative`, kept for compatibility * `details.market` (`trend` on every tier; `tam`/`sam`/`som`/`growthRate` on deep reports only, `null` and named under `locked.fields` on a starter scan, which has no research step behind them), `details.competitors`, `details.swot`, `details.risks`, `details.validation` * `details.quickTake`, `details.situationBriefing` (string), `details.actionPlanVariants` * `details.citations` - deduped `{ title, url }` * `details.scores` - `compositeScore` plus per-framework subscores * `details.cloneability` - see below ### `details.cloneability` The one field whose shape changes with tier instead of going `null`. Branch on the fields you need rather than on tier: `null` means the run has no cloneability section at all, which is normal for analyses created before this field existed. | Field | Type | Tier | | - | - | - | | `mode` | `"software"` \| `"non_software"` | every | | `verdict` | `"YES"` \| `"KINDA"` \| `"NOT_REALLY"` - `"YES"` means trivially copyable | every | | `teaserLine` | string | every | | `reasoning` | string | deep | | `cloneableParts`, `moatParts` | string\[] | deep | | `mitigations` | `{ title, description }[]` | deep | | `comparableApps` | `{ name, verdict, note, domain? }[]` | deep, `software` mode | | `timeToClone` | `{ horizon: "days" \| "weeks" \| "months" \| "year_plus", note }`, optional | deep | | `bigPlayerDefense` | `{ player, threat, defense }`, optional | deep | ### `details.validation.featureTriage` Each entry is `{ feature, decision, status, impact, effort, reason }`. `decision` normalizes the model's free-text `status` to `"build"`, `"defer"`, `"cut"` or `null`; `status` is kept alongside so the original label stays readable. ## Deep-only fields * `details.sections` - business model, execution fit, go-to-market, lean canvas, Porter forces, VC scorecard, PMF signals, financial projections, raise plan, pre-mortem, workflow evidence, display metrics, synthesis, consistency review, section briefings, Skeptic's View * `details.market` extras - `segments`, `industryTrends`, `competitivePositioning`, `geographicFocus`, `regulatoryLandscape` (empty or `null` on starter exports) * Full competitor cards - funding, estimated users, market share, activity level, threat level, scale tier and evidence, strengths, exploit tactics (starter exports keep `name` + `url` only) * `details.pivots` - `{ suggestions, generatedAt }` * `details.communityDemand` * `details.founderFit`, `details.playbook`, `details.proofOfDemand`, `details.googleTrends` - once the [modules](/modules) have been generated On starter runs all deep-only fields are `null`. Exports are deterministic: the same run state always serializes identically. With `verbosity=summary`, `details.sections` keeps exactly one subsection, `synthesis`. Everything else in `details.sections` is dropped and listed under `details.omitted`. ## Batches `POST /api/agent/analysis-batches` accepts up to 5 items, each with its own `clientRunId` and `scanType` (mix starter and deep intentionally). The batch export includes only completed, export-ready items, plus `omittedItems` explaining every skipped item and aggregate `counts.exported` / `counts.omitted`. # Webhooks Source: https://docs.preuve.ai/webhooks One signed POST per finished client report, on the URL your workspace already uses for scanner leads. A Consultant or Agency workspace can save one webhook URL in [Dashboard → API](https://preuve.ai/consultants/dashboard?tab=api). Every new scanner lead is posted there, and so is every client report started through `POST /api/agent/agency/analyses` once it reaches a terminal status. One URL, one signing secret, one event header: a portal that polls `GET /api/agent/agency/reports/{id}` can stop polling. Reports started from the dashboard itself are not posted. They are the consultant's own clicks, and a channel wired for the portal's runs should not hear about them. The list route still returns them. ## Events | `X-Preuve-Event` | When | | - | - | | `report.completed` | An API-started client report reached `COMPLETED`. Its export is ready. | | `report.failed` | An API-started client report reached `FAILED`. A deep report's project credit is returned. | | `report.test` | The dashboard's "Send a report sample" button. Same body as `report.completed`. | | `lead.completed` | A scanner lead's starter scan finished. | | `lead.held` | A scanner lead was held because the day's starter scans were used. | | `lead.test` | The dashboard's "Send a test" button. | Each `(report, event)` pair is sent once. A retried run on our side never produces a second `report.completed` for the same report. Delivery is one attempt with a 5 second timeout and no retry, so a receiver that was down keeps polling for that one report. Answer with any 2xx; redirects are not followed. ## Headers | Header | Value | | - | - | | `Content-Type` | `application/json` | | `User-Agent` | `Preuve-Webhook/1` | | `X-Preuve-Event` | The event name above | | `X-Preuve-Delivery` | A UUID per delivery, also `delivery_id` in the body | | `X-Preuve-Signature` | `sha256=`, HMAC-SHA256 of the raw body with your secret | A `hooks.slack.com` URL gets `{ "text": "..." }` instead, with no signature: one readable line per event. ## Verifying the signature The secret is shown once, when the URL is saved. Compute the HMAC over the raw request bytes, before any JSON parsing, and compare in constant time. ```js theme={null} import { createHmac, timingSafeEqual } from 'node:crypto'; function verify(rawBody, signatureHeader, secret) { const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex'); return ( expected.length === signatureHeader.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader)) ); } ``` ## Payload: `report.completed` ```json theme={null} { "event": "report.completed", "sent_at": "2026-11-09T14:02:11.482Z", "delivery_id": "3f1a4c2e-7b8d-4e1f-9a2b-6c5d4e3f2a1b", "workspace": { "id": "a1b2c3d4-...", "name": "SEVA Systems", "slug": "seva-systems" }, "report": { "reportId": "9d8c7b6a-...", "clientRunId": "portal-2026-11-09-017", "status": "COMPLETED", "scanType": "deep", "title": "Waitlist booking assistant for physiotherapists", "reportUrl": "https://preuve.ai/app/agency-report/9d8c7b6a-...", "completedAt": "2026-11-09T14:02:09.913Z", "export": { "json": "https://preuve.ai/api/agent/agency/reports/9d8c7b6a-.../export", "markdown": "https://preuve.ai/api/agent/agency/reports/9d8c7b6a-.../export?format=markdown" } }, "links": { "dashboard": "https://preuve.ai/consultants/dashboard" } } ``` Both events cover deep reports and Starter Scans started through the API (`scanType` says which). Reports started from the dashboard or the scanner never send them. `report` carries the same field names as the poll response, plus the `clientRunId` you sent at the start, the report's title and the two export URLs. The body never carries the idea text or the report content: fetch `export.json` or `export.markdown` with a key holding `agency:read`, exactly as you would after a poll. On `report.failed`, `status` is `FAILED`, `completedAt` and `export` are `null`. ## Testing a receiver Save the URL, then use the two buttons under it: "Send a test" posts a `lead.test`, "Send a report sample" posts a `report.test` with the shape above and a random `reportId`. Both are signed with your secret, so a receiver that verifies the sample verifies the real thing. The sample's export URLs answer `404 REPORT_NOT_FOUND`: do not fetch them, check the event name first.