> ## Documentation Index
> Fetch the complete documentation index at: https://docs.preuve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Start an analysis

> 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.




## OpenAPI

````yaml /api-reference/openapi.yaml post /api/agent/analyses
openapi: 3.1.0
info:
  title: Preuve Agent API
  version: '2.0'
  description: >
    HMAC-signed API for programmatic startup idea validation. Every request
    carries x-preuve-key, x-preuve-timestamp, x-preuve-nonce, and
    x-preuve-signature headers (HMAC-SHA256 over a canonical string - see the
    Authentication guide). The interactive playground cannot compute signatures;
    use it for shapes only.
servers:
  - url: https://preuve.ai
security:
  - preuveKey: []
paths:
  /api/agent/analyses:
    post:
      tags:
        - Analyses
      summary: Start an analysis
      description: >
        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.
      operationId: createAnalysis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnalysisRequest'
      responses:
        '200':
          description: Run created (or replayed via clientRunId).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisRun'
        '402':
          $ref: '#/components/responses/InsufficientTokens'
        '403':
          description: Starter scan limit reached (STARTER_LIMIT_REACHED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    CreateAnalysisRequest:
      type: object
      required:
        - clientRunId
        - scanType
        - idea
      properties:
        clientRunId:
          type: string
          description: Caller-chosen idempotency id. Reusing it replays the existing run.
        scanType:
          type: string
          enum:
            - starter
            - deep
          description: >-
            "starter" costs nothing; "deep" runs the full paid analysis and
            consumes account quota. "free" is accepted as a legacy alias of
            "starter".
        idea:
          type: string
          description: The startup idea, in plain language.
        targetMarket:
          type: string
        targetCountry:
          type: string
          description: ISO country code, e.g. "US" or "FR".
        title:
          type: string
        stage:
          type: string
        budget:
          type: string
        language:
          type: string
          default: en
        enrichmentMode:
          type: string
          enum:
            - core
            - none
          default: core
          description: >-
            "core" also generates the export-required sections; "none" returns
            the raw completion only.
        publish:
          type: boolean
          description: When true, creates a public share URL for the report.
      example:
        clientRunId: my-run-001
        scanType: free
        idea: >-
          A scheduling assistant that helps independent coffee shops coordinate
          weekly local supplier orders with lower waste.
        targetMarket: Independent coffee shops
        targetCountry: US
        enrichmentMode: core
        publish: true
    AnalysisRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        reportId:
          type: string
          format: uuid
        clientRunId:
          type: string
        scanType:
          type: string
          enum:
            - starter
            - deep
          description: Your request type. Reliable from creation, even while PROCESSING.
        reportType:
          type: string
          enum:
            - quick
            - deep_dive
        analysisTier:
          type: string
          enum:
            - basic
            - advanced
          description: >-
            Derived from the report. Deep runs read "basic" until deep sections
            land.
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - COMPLETED
            - FAILED
        readyForExport:
          type: boolean
        enrichment:
          $ref: '#/components/schemas/EnrichmentState'
        modules:
          type: object
          nullable: true
          description: Per-module statuses. Deep reports only; null on free runs.
          properties:
            proofOfDemand:
              $ref: '#/components/schemas/ModuleStatus'
            founderFit:
              $ref: '#/components/schemas/ModuleStatus'
            playbook:
              $ref: '#/components/schemas/ModuleStatus'
            trends:
              $ref: '#/components/schemas/ModuleStatus'
        reportUrl:
          type: string
          format: uri
        shareUrl:
          type: string
          format: uri
          nullable: true
    ApiError:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Stable machine-readable code. Branch on this.
        details:
          description: Optional context (validation errors, limits, ...).
    EnrichmentState:
      type: object
      properties:
        mode:
          type: string
          enum:
            - core
            - none
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
        required:
          type: array
          items:
            type: string
        completed:
          type: array
          items:
            type: string
    ModuleStatus:
      type: object
      properties:
        status:
          type: string
          enum:
            - not_generated
            - generating
            - failed
            - completed
  responses:
    InsufficientTokens:
      description: No quota and no tokens for a deep scan (INSUFFICIENT_TOKENS).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Rate limited (RATE_LIMITED or DAILY_LIMIT_REACHED).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    preuveKey:
      type: apiKey
      in: header
      name: x-preuve-key
      description: >
        API key id. Requests are additionally signed with x-preuve-timestamp,
        x-preuve-nonce, and x-preuve-signature (HMAC-SHA256) - see the
        Authentication guide.

````