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

# Vet a proposal

> Compare a proposal with a completed specification and return the assessment.

Provide `specId` and either an existing `proposalId`, or a new `proposalName` with `text` or `file`. An existing `proposalId` takes precedence over file/text fields.

```bash theme={null}
curl --fail-with-body https://api.pre.dev/vet-proposal \
  -H "Authorization: Bearer $PREDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "specId": "507f1f77bcf86cd799439011",
    "proposalName": "Reporting dashboard implementation",
    "text": "We propose organization-scoped reports, CSV export, and audit logging delivered in three milestones."
  }'
```

Replace the example ID with an actual completed specification ID. The HTTP `200` response contains `success`, `vettedProposal`, and `proposal`. The assessment's `_id` is used to [retrieve it later](/architect-agent/api/get-vetted-proposal).

## Billing behavior

This operation charges **100 credits before later proposal validation and analysis**. Check the specification, proposal ID, name, and content before calling it. There is no documented idempotency key, async mode, or automatic refund guarantee for validation/analysis failures. Check [existing assessments](/architect-agent/api/list-vetted-proposals) before retrying a request whose outcome is uncertain.

Insufficient credits returns `402`. Input or ID validation can return `400`; a missing proposal can return `404`. Read the [proposal workflow](/architect-agent/proposals) for assessment fields.


## OpenAPI

````yaml api-reference/openapi.json POST /vet-proposal
openapi: 3.1.0
info:
  title: pre.dev API
  description: >-
    Public REST API for software specifications, browser automation, proposal
    assessment, and credit balance. Base URL: https://api.pre.dev. MCP is
    documented separately at https://docs.pre.dev/mcp/tools.
  version: 1.1.0
  contact:
    name: pre.dev Support
    url: https://pre.dev
    email: support@pre.dev
  license:
    name: Proprietary
    url: https://pre.dev/terms
servers:
  - url: https://api.pre.dev
    description: Production API Server
security:
  - apiKeyAuth: []
  - xApiKey: []
tags:
  - name: Specifications
  - name: Browser Agents
  - name: Proposals
  - name: Account
paths:
  /vet-proposal:
    post:
      tags:
        - Proposals
      summary: Vet a proposal
      description: >-
        Compare an existing proposal, or upload and compare a new one, against a
        spec. Charges 100 credits before later proposal validation and lookup.
        Confirm inputs first; a failed request does not guarantee a refund. No
        async mode or idempotency key.
      operationId: vetProposal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VetProposalRequest'
            example:
              specId: 507f1f77bcf86cd799439011
              proposalId: 507f1f77bcf86cd799439012
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VetProposalRequest'
      responses:
        '200':
          description: Assessment and proposal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VetProposalResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, or ineligible authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Insufficient balance or a billing gate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Record unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: cURL
          source: |-
            curl --fail-with-body https://api.pre.dev/vet-proposal \
              -H "Authorization: Bearer $PREDEV_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "specId": "507f1f77bcf86cd799439011",
              "proposalId": "507f1f77bcf86cd799439012"
            }'
components:
  schemas:
    VetProposalRequest:
      type: object
      required:
        - specId
      properties:
        specId:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        proposalId:
          type: string
          description: >-
            Existing proposal ID. When supplied, file, text, and proposalName
            are ignored.
          pattern: ^[a-fA-F0-9]{24}$
        proposalName:
          type: string
          minLength: 1
        text:
          type: string
          minLength: 1
        file:
          type: string
          description: New proposal file, at most 20 MiB, with a supported MIME type.
          format: binary
      anyOf:
        - required:
            - proposalId
        - required:
            - proposalName
            - text
        - required:
            - proposalName
            - file
    VetProposalResponse:
      type: object
      required:
        - success
        - vettedProposal
        - proposal
      properties:
        success:
          type: boolean
        vettedProposal:
          anyOf:
            - $ref: '#/components/schemas/VettedProposal'
            - type: 'null'
        proposal:
          $ref: '#/components/schemas/Proposal'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          description: Optional detail; not returned by every endpoint.
        code:
          type: string
          description: Machine-readable code when available.
        actionUrl:
          type: string
          format: uri
        requiresSubscription:
          type: boolean
        trialsUsed:
          type: integer
        maxTrials:
          type: integer
      additionalProperties: true
    VettedProposal:
      type: object
      required:
        - _id
        - specId
        - proposalId
        - shouldAccept
      properties:
        _id:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        specId:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        proposalId:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        shouldAccept:
          type: boolean
        acceptanceConfidence:
          type: number
          minimum: 0
          maximum: 100
        overallAlignment:
          type: number
          minimum: 0
          maximum: 100
        strengths:
          type: array
          items:
            type: string
        weaknesses:
          type: array
          items:
            type: string
        criticalGaps:
          type: array
          items:
            type: string
        recommendations:
          type: array
          items:
            type: string
        executiveSummary:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
    Proposal:
      type: object
      required:
        - _id
        - proposalName
      properties:
        _id:
          type: string
          description: 24-character record ID.
          pattern: ^[a-fA-F0-9]{24}$
        proposalName:
          type: string
        proposalContent:
          type: string
        proposalFile:
          anyOf:
            - $ref: '#/components/schemas/ProposalFile'
            - type: 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      description: Stored proposal. Additional metadata can be present.
      additionalProperties: true
    ProposalFile:
      type: object
      properties:
        fileName:
          type: string
        fileUrl:
          type: string
          format: uri
        fileType:
          type: string
        fileSize:
          type: integer
          description: Bytes.
        uploadedAt:
          type: string
          format: date-time
      additionalProperties: true
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Use a pre.dev API key from https://pre.dev/projects/key.
    xApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Alternative to Authorization: Bearer.'

````