> ## Documentation Index
> Fetch the complete documentation index at: https://paperplane-justin-winter-s-projects.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Suggest a mail class for a draft

> Advisory only, never authoritative — the sender always picks. LLM-backed when ANTHROPIC_API_KEY is set, word-bounded heuristic otherwise.



## OpenAPI

````yaml /openapi.json post /v1/suggest-class
openapi: 3.1.0
info:
  title: paperplane API
  version: 1.0.0
  summary: Send real physical mail from code.
  description: >-
    Upload a PDF or paste text; we print it and hand it to USPS the next
    business day. No account required — pay per letter with a Stripe link or a
    prepaid credit code, and use `sandbox: true` to exercise the whole flow for
    free.


    Every failure returns the same envelope: `status`, a stable machine-readable
    `code`, a human `reason`, and a `next` array of concrete recovery steps.


    This document is generated from the same zod schemas the server validates
    with, so it cannot describe an endpoint that does not exist.
  contact:
    name: paperplane support
    url: https://sendpaperplane.com/contact
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
  termsOfService: https://sendpaperplane.com/terms
servers:
  - url: https://sendpaperplane.com
    description: Production
security: []
tags:
  - name: Mail
    description: Quote, send, track, and cancel letters.
  - name: Credits
    description: Prepaid balances that pay for letters without a card.
  - name: Reviews
    description: Post-delivery feedback. Identity is derived from the order, not supplied.
  - name: Addresses
    description: >-
      Typeahead and reverse geocoding. Convenience only; USPS verification is
      authoritative.
  - name: Meta
    description: Machine-readable description of this API.
paths:
  /v1/suggest-class:
    post:
      tags:
        - Mail
      summary: Suggest a mail class for a draft
      description: >-
        Advisory only, never authoritative — the sender always picks. LLM-backed
        when ANTHROPIC_API_KEY is set, word-bounded heuristic otherwise.
      operationId: suggestMailClass
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuggestClassRequest'
            example:
              text: >-
                This letter serves as formal notice that your lease will not be
                renewed.
      responses:
        '200':
          description: A suggestion plus one sentence of reasoning
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuggestClassResponse'
              example:
                status: ok
                suggested_class: certified
                reason: >-
                  This reads as a formal legal notice, where proof of delivery
                  matters.
                source: heuristic
        '400':
          description: Missing or oversized text.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited (10/minute per IP).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                example: 60
components:
  schemas:
    SuggestClassRequest:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 50000
      required:
        - text
    SuggestClassResponse:
      type: object
      properties:
        status:
          type: string
          const: ok
        suggested_class:
          $ref: '#/components/schemas/MailClass'
        reason:
          type: string
        source:
          type: string
          enum:
            - heuristic
            - llm
      required:
        - status
        - suggested_class
        - reason
        - source
    Error:
      type: object
      properties:
        status:
          type: string
          enum:
            - failed
            - action_required
        code:
          type: string
        reason:
          type: string
        next:
          type: array
          items:
            type: string
      required:
        - status
        - code
        - reason
        - next
    MailClass:
      type: string
      enum:
        - first_class
        - certified
        - certified_err
        - priority

````