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

# Address typeahead

> Server-side proxy so the geocoding key never reaches a browser. Returns `enabled: false` with no suggestions when no key is configured. Suggestions are convenience only — USPS verification at order time remains authoritative.



## OpenAPI

````yaml /openapi.json get /v1/address/autocomplete
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/address/autocomplete:
    get:
      tags:
        - Addresses
      summary: Address typeahead
      description: >-
        Server-side proxy so the geocoding key never reaches a browser. Returns
        `enabled: false` with no suggestions when no key is configured.
        Suggestions are convenience only — USPS verification at order time
        remains authoritative.
      operationId: autocompleteAddress
      parameters:
        - name: q
          in: query
          required: false
          description: >-
            Partial address. Missing, or fewer than 3 characters, returns no
            suggestions rather than an error.
          schema:
            type: string
            maxLength: 120
      responses:
        '200':
          description: >-
            Up to 5 US address suggestions. Degrades to an empty list rather
            than an error when no key is configured (`enabled: false`), when `q`
            is under 3 or over 120 characters, or when the upstream geocoder
            fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutocompleteResponse'
              example:
                enabled: true
                suggestions:
                  - label: 742 Evergreen Terrace, Springfield, IL 62704
                    line1: 742 Evergreen Terrace
                    city: Springfield
                    state: IL
                    zip: '62704'
                    lat: 39.78
                    lon: -89.65
        '429':
          description: >-
            Rate limited (30/minute per IP). Unlike the degraded cases above,
            this is the standard error envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                example: 60
components:
  schemas:
    AutocompleteResponse:
      type: object
      properties:
        enabled:
          type: boolean
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/AddressSuggestion'
      required:
        - enabled
        - suggestions
    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
    AddressSuggestion:
      type: object
      properties:
        label:
          type: string
        line1:
          type: string
        city:
          type: string
        state:
          type: string
        zip:
          type: string
        lat:
          type: number
        lon:
          type: number
      required:
        - label
        - line1
        - city
        - state
        - zip
        - lat
        - lon

````