Reading these docs programmatically
- Every docs page has a Markdown twin: append
.mdto its URL (e.g.https://docs.preuve.ai/quickstart.md). - The full docs index lives at
/llms.txt; the complete content in one file at/llms-full.txt. - This docs site is itself an MCP server: connect
https://docs.preuve.ai/mcpfrom 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(YAML at/openapi.yaml, RFC 9727 catalog at/.well-known/api-catalog) and here at/api-reference/openapi.yaml. Same file, generated from one source. GET https://preuve.ai/api/agentis 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 from any client mints one over OAuth on a free account. Creating one by hand in Account → API Keys needs a paid personal plan or membership of a Consultant or Agency workspace with an active subscription - see 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 reportsmodules: nullwhile polling, and its export omits the deep-only sections (each one is named in the report’sdetails.omitted). Explore withstarter, then switch the one field when the user asks for the full report.
Agent guidance rules
- Prefer the MCP server when it is connected. Fall back to plain HTTP with the
x-preuve-keyheader (HTTP API) - there is no client library to install. If you can load skills, install the Agent Skill - it encodes everything on this page plus the full workflow. scanTypeis 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.- Reuse the same
clientRunIdto retry. Retries never double-spend; a run that already started returns its stored outcome instead of running again. - 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_LIMITEDandCONCURRENT_LIMIT_REACHEDare retryable with the sameclientRunId. - Branch on
code, not on error messages. Every error is a stable{ error, code }envelope - see Errors. - Do not expose secrets in chat. Never ask the user to paste
PREUVE_API_KEYinto a conversation, and never echo it back. Prefer environment variables or the MCP server config. - Do not pass
publish: trueunless the user explicitly wants a public share link. Runs are private by default. - Deep modules are capped at one successful generation per module per report. A
409 MODULE_ALREADY_GENERATEDmeans 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.
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, 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”:
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:readcovers listing, reading and exporting client reports;agency:writestarts 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:readincludes 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.
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.
Recommended agent workflow
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 an AI Context Pack is on offer), so do not derive it yourself
from scanType. Running the idea again here with start_analysis and
exporting that run works in every case.