openapi: 3.0.3
info:
  title: Datpaq ProAPI
  description: >-
    Multi-service API platform covering the live Datpaq catalog: geocoding, EV charging, weather, aviation, holidays,
    QR/PDF generation, enrichment, and utilities. All endpoints require authentication via API key passed as an
    x-api-key header or api_key query parameter.
  version: 1.1.0
  contact:
    name: Datpaq Support
    url: https://datpaq.com
  license:
    name: Proprietary
servers:
  - url: https://datpaq.com/api/v1
    description: Production
  - url: https://staging.datpaq.com/api/v1
    description: Staging
security:
  - ApiKeyHeader: []
  - ApiKeyQuery: []
tags:
  - name: Aircraft
    description: FAA aircraft registration lookup by tail, ICAO hex, and type code
  - name: Breach Check
    description: Email breach exposure, password k-anonymity checks, and breach catalog
  - name: Calendar
    description: Month, day, and range calendars with optional public-holiday overlays
  - name: Color Convert
    description: Color conversion across formats with contrast and gradient helpers
  - name: Convert Time
    description: Timezone-aware datetime conversion
  - name: Country Codes
    description: ISO 3166-1 country lookup, search, fuzzy match, and export
  - name: Current Time
    description: Current time by IANA timezone identifier
  - name: Data Format Convert
    description: Convert data between JSON, CSV, XML, YAML, and spreadsheet formats
  - name: Deslop
    description: Detect and rewrite AI writing patterns in text
  - name: Dictionary
    description: English word definitions, phonetics, and fuzzy suggestions
  - name: Diffy
    description: Web page snapshots and change diffs against a previous snapshot
  - name: DNS Lookup
    description: Forward and reverse DNS resolution for domains and IP addresses
  - name: Document Convert
    description: Convert office documents, PDF, and text formats
  - name: Document Generation
    description: Generate business documents (invoices, letters, forms) as PDF, DOCX, or HTML
  - name: Domain Lookup
    description: Domain TLD classification, regional metadata, and DNS presence checks
  - name: Economic Indicators
    description: Macroeconomic indicator catalog, series history, and interest rates
  - name: Encoding Convert
    description: Encode, decode, hash, JWT-decode, normalize, and data-URI conversions
  - name: EV Charger
    description: EV charging station search, station detail, and network/plug/level reference data
  - name: GDP
    description: US GDP levels, history, growth, and dataset comparison
  - name: Geocoding
    description: Forward, reverse, and batch geocoding via OpenStreetMap Nominatim
  - name: Helicopter
    description: FAA rotorcraft lookup by tail, ICAO hex, serial, manufacturer, and model
  - name: IBAN
    description: IBAN structure and mod-97 checksum validation with country metadata
  - name: Image Processing
    description: Image resize, compress, convert, crop, and pipeline operations
  - name: Income Tax
    description: US federal income tax estimates and brackets
  - name: Interest Rate
    description: Current benchmark interest rates and the Treasury yield curve
  - name: IP Geolocation
    description: Geographic location data for IPv4 and IPv6 addresses
  - name: IP Intelligence
    description: Threat intelligence and risk scoring for IP addresses
  - name: LIBOR
    description: SOFR-first benchmark rates with archival LIBOR history and tenor spreads
  - name: Logo
    description: Discover a company's logos, icons, and brand palette by domain
  - name: Lorem Ipsum
    description: Placeholder text generation as JSON, text, or HTML
  - name: MAC Address
    description: MAC address vendor identification from IEEE OUI registry data
  - name: Markdown Convert
    description: Markdown to HTML, HTML to Markdown, plaintext, and document outlines
  - name: Market Cap
    description: Company market capitalization lookups, history, trends, and rankings
  - name: Mortgage Calculator
    description: Mortgage payment, refinance break-even, and current mortgage rates
  - name: MX Lookup
    description: Mail exchange record lookup with optional SPF and SMTP checks
  - name: OCR
    description: Extract text from PDFs and images, with optional OCR
  - name: PDF Generation
    description: SSRF-safe PDF rendering from a public URL or sanitized HTML
  - name: PDF Toolkit
    description: Merge, split, extract, rotate, watermark, compress, encrypt, and inspect PDFs
  - name: Ping Human
    description: Escalate a decision to a human via Slack or email and collect the reply
  - name: Profanity
    description: Content moderation and profanity detection
  - name: Public Holidays
    description: Public holiday lookup for 200+ countries with JSON or CSV output
  - name: QR Code
    description: QR code generation (PNG/SVG) and decode from a base64 image
  - name: Sample Data
    description: Mock data generation for testing and development (Faker.js)
  - name: SEC Filings
    description: SEC EDGAR company profiles, filings, and XBRL facts
  - name: Spell Check
    description: Multilingual spelling correction with optional grammar hints
  - name: Structured Extraction
    description: Extract structured fields from a web page or HTML using CSS selectors
  - name: Tech Stack Detection
    description: Detect the technologies a website uses
  - name: Text Language
    description: Language detection with ISO codes and confidence scores
  - name: Thesaurus
    description: Synonyms, antonyms, and related terms from WordNet
  - name: Translate
    description: Text translation between supported languages
  - name: Unemployment
    description: US unemployment rates, labor force, claims, demographics, and states
  - name: Unit Conversion
    description: Unit conversion across 100+ measurement types
  - name: US States
    description: US state list, abbreviation, FIPS, and batch abbreviation lookup
  - name: User Avatar
    description: Dynamic user avatar generation in PNG, WebP, or SVG
  - name: Validate IP
    description: IP address validation and classification (IPv4, IPv6, CIDR)
  - name: VAT Validation And Rates
    description: VAT number validation, VAT rates by country, and VAT price calculation
  - name: VIN Lookup
    description: NHTSA VIN decode, makes list, and prefix suggestions
  - name: Weather
    description: Normalized current conditions and forecast by latitude and longitude
  - name: Web Scraping
    description: Headless scrape, batch, crawl, and site-map extraction
  - name: Web Screenshot
    description: Web page screenshot capture via headless browser
  - name: Web Search
    description: Web search for a single query or a batch of up to 10 queries
  - name: WHOIS
    description: Domain WHOIS registration data lookup
  - name: Working Days
    description: Business day calculations with regional holiday support
paths:
  /convert-time:
    get:
      tags:
        - Convert Time
      operationId: convertTime
      summary: Convert a datetime between timezones
      description: >
        Converts a datetime value from a source timezone to a target timezone. Accepts ISO 8601 strings, Unix epoch
        timestamps, or omit sourceTime to convert the current time.
      parameters:
        - name: sourceTime
          in: query
          required: false
          description: Time to convert (ISO 8601 or Unix ms). Defaults to current time.
          schema:
            type: string
            example: "2025-12-31T12:00:00Z"
        - name: sourceZone
          in: query
          required: true
          description: Source IANA timezone identifier
          schema:
            type: string
            example: America/New_York
        - name: targetZone
          in: query
          required: true
          description: Target IANA timezone identifier
          schema:
            type: string
            example: Europe/London
      responses:
        "200":
          description: Converted datetime with timezone metadata
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  base_location:
                    datetime: "2026-07-02 09:30:00"
                    timezone_name: EDT
                    timezone_location: America/New_York
                    gmt_offset: -4
                    is_dst: true
                    latitude: 40.7128
                    longitude: -74.006
                  target_location:
                    datetime: "2026-07-02 14:30:00"
                    timezone_name: BST
                    timezone_location: Europe/London
                    gmt_offset: 1
                    is_dst: true
                    latitude: 51.5074
                    longitude: -0.1278
                meta:
                  correlationId: abc123-def456
                  timestamp: "2026-07-02T13:30:00.000Z"
                  processingTime: 18ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /current-time:
    get:
      tags:
        - Current Time
      operationId: currentTime
      summary: Get current time for an IANA timezone
      description: Returns the current date/time with UTC offset and DST status for a given timezone.
      parameters:
        - name: target
          in: query
          required: true
          description: IANA timezone identifier (e.g. America/New_York, UTC, Asia/Tokyo)
          schema:
            type: string
            example: America/New_York
      responses:
        "200":
          description: Current time data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  datetime: "2026-07-02T09:30:00-04:00"
                  timezone_name: EDT
                  timezone_location: America/New_York
                  gmt_offset: -4
                  is_dst: true
                  latitude: 40.7128
                  longitude: -74.006
                meta:
                  correlationId: ghi789-jkl012
                  timestamp: "2026-07-02T13:30:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/process:
    post:
      tags:
        - Image Processing
      operationId: imagePipeline
      summary: Run an image through a multi-step operation pipeline
      description: >
        Executes an ordered array of image operations in a single request. Recommended over individual endpoints when
        multiple operations are needed. Supports resize, compress, convert, crop, and metadata.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
                - operations
              properties:
                image_url:
                  type: string
                  format: uri
                  example: https://example.com/photo.jpg
                operations:
                  type: array
                  items:
                    type: object
                    required:
                      - operation
                    properties:
                      operation:
                        type: string
                        enum:
                          - resize
                          - compress
                          - convert
                          - crop
                          - metadata
                      width:
                        type: integer
                        minimum: 1
                      height:
                        type: integer
                        minimum: 1
                      quality:
                        type: integer
                        minimum: 1
                        maximum: 100
                      format:
                        type: string
                        enum:
                          - jpeg
                          - png
                          - webp
                          - avif
            example:
              image_url: https://example.com/photo.jpg
              operations:
                - type: resize
                  width: 800
                - type: convert
                  format: webp
      responses:
        "200":
          description: Processed image binary or JSON metadata
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/resize:
    post:
      tags:
        - Image Processing
      operationId: imageResize
      summary: Resize an image to specified dimensions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
              properties:
                image_url:
                  type: string
                  format: uri
                width:
                  type: integer
                  example: 800
                height:
                  type: integer
                  example: 600
                fit:
                  type: string
                  enum:
                    - cover
                    - contain
                    - fill
                    - inside
                    - outside
                  default: cover
            example:
              image_url: https://example.com/photo.jpg
              width: 800
              height: 600
              fit: cover
      responses:
        "200":
          description: Resized image binary
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/compress:
    post:
      tags:
        - Image Processing
      operationId: imageCompress
      summary: Compress an image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
              properties:
                image_url:
                  type: string
                  format: uri
                quality:
                  type: integer
                  minimum: 1
                  maximum: 100
                  example: 75
            example:
              image_url: https://example.com/photo.jpg
              quality: 80
      responses:
        "200":
          description: Compressed image binary
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/convert:
    post:
      tags:
        - Image Processing
      operationId: imageConvert
      summary: Convert image to a different format
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
                - format
              properties:
                image_url:
                  type: string
                  format: uri
                format:
                  type: string
                  enum:
                    - jpeg
                    - png
                    - webp
                    - avif
                  example: webp
            example:
              image_url: https://example.com/photo.jpg
              format: webp
      responses:
        "200":
          description: Converted image binary
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/crop:
    post:
      tags:
        - Image Processing
      operationId: imageCrop
      summary: Crop an image to a region
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
                - x
                - "y"
                - width
                - height
              properties:
                image_url:
                  type: string
                  format: uri
                x:
                  type: integer
                  minimum: 0
                "y":
                  type: integer
                  minimum: 0
                width:
                  type: integer
                  minimum: 1
                height:
                  type: integer
                  minimum: 1
            example:
              image_url: https://example.com/photo.jpg
              left: 0
              top: 0
              width: 400
              height: 400
      responses:
        "200":
          description: Cropped image binary
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/metadata:
    post:
      tags:
        - Image Processing
      operationId: imageMetadata
      summary: Extract metadata from an image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
              properties:
                image_url:
                  type: string
                  format: uri
            example:
              image_url: https://example.com/photo.jpg
      responses:
        "200":
          description: Image metadata (dimensions, format, EXIF, color profile)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                format: jpeg
                width: 1920
                height: 1080
                size: 245760
                colorSpace: srgb
                hasAlpha: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ip-geolocation:
    get:
      tags:
        - IP Geolocation
      operationId: ipGeolocationGet
      summary: Get geographic location for an IP address
      description: |
        Returns country, region, city, coordinates, ISP, ASN, and timezone for any IPv4 or IPv6 address.
      parameters:
        - name: ip
          in: query
          required: true
          schema:
            type: string
            example: 8.8.8.8
      responses:
        "200":
          description: Geolocation data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                ip: 8.8.8.8
                location:
                  country: United States
                  region: California
                  city: Mountain View
                  latitude: 37.386
                  longitude: -122.0838
                network:
                  network: 8.8.8.0/24
                  asn: 15169
                  org: Google LLC
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - IP Geolocation
      operationId: ipGeolocationPost
      summary: Get geographic location for an IP address (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ip
              properties:
                ip:
                  type: string
                  example: 8.8.8.8
            example:
              ip: 8.8.8.8
      responses:
        "200":
          description: Geolocation data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                ip: 8.8.8.8
                location:
                  country: United States
                  region: California
                  city: Mountain View
                  latitude: 37.386
                  longitude: -122.0838
                network:
                  network: 8.8.8.0/24
                  asn: 15169
                  org: Google LLC
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ip-geolocation/batch:
    post:
      tags:
        - IP Geolocation
      operationId: ipGeolocationBatch
      summary: Batch IP geolocation lookup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ips
              properties:
                ips:
                  type: array
                  items:
                    type: string
                  maxItems: 100
                  example:
                    - 8.8.8.8
                    - 1.1.1.1
            example:
              ips:
                - 8.8.8.8
                - 1.1.1.1
                - 208.67.222.222
              include_logs: false
      responses:
        "200":
          description: Geolocation data for each IP
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                summary:
                  total_requested: 3
                  valid_ips: 3
                  invalid_ips: 0
                  found: 2
                  not_found: 1
                  errors: 0
                  processing_time_ms: 45
                results:
                  - ip: 8.8.8.8
                    found: true
                    location:
                      country: United States
                      region: California
                      city: Mountain View
                      latitude: 37.386
                      longitude: -122.0838
                    network:
                      network: 8.8.8.0/24
                      asn: AS15169
                      org: Google LLC
                  - ip: 1.1.1.1
                    found: true
                    location:
                      country: Australia
                      region: New South Wales
                      city: Sydney
                      latitude: -33.8688
                      longitude: 151.2093
                    network:
                      network: 1.1.1.0/24
                      asn: AS13335
                      org: Cloudflare, Inc.
                  - ip: 208.67.222.222
                    found: false
                    error: IP not found in geolocation database
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ip-intelligence:
    get:
      tags:
        - IP Intelligence
      operationId: ipIntelligenceGet
      summary: Get threat intelligence for an IP address
      description: >
        Returns trust score, risk classification, VPN/proxy/Tor detection, datacenter detection, and threat categories.
        Omit the ip parameter to analyze the caller's IP.
      parameters:
        - name: ip
          in: query
          required: false
          description: IP to analyze. Omits to use the caller's IP.
          schema:
            type: string
            example: 8.8.8.8
      responses:
        "200":
          description: IP threat intelligence data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                ip: 203.0.113.45
                id: 1
                network: 203.0.113.0/24
                description: Example Block
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ip-intelligence/batch:
    post:
      tags:
        - IP Intelligence
      operationId: ipIntelligenceBatch
      summary: Batch IP threat intelligence lookup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ips
              properties:
                ips:
                  type: array
                  items:
                    type: string
                  maxItems: 100
                  example:
                    - 8.8.8.8
                    - 1.1.1.1
            example:
              ips:
                - 8.8.8.8
                - 1.1.1.1
                - 208.67.222.222
      responses:
        "200":
          description: Threat intelligence for each IP
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                summary:
                  total_requested: 3
                  valid_ips: 3
                  invalid_ips: 0
                  found: 2
                  not_found: 1
                  errors: 0
                  processing_time_ms: 42
                results:
                  - ip: 8.8.8.8
                    found: true
                    data:
                      network: 8.8.8.0/24
                      country: United States
                      region: California
                      city: Mountain View
                      asn: AS15169
                      org: Google LLC
                  - ip: 1.1.1.1
                    found: true
                    data:
                      network: 1.1.1.0/24
                      country: Australia
                      region: New South Wales
                      city: Sydney
                      asn: AS13335
                      org: Cloudflare, Inc.
                  - ip: 208.67.222.222
                    found: false
                    error: IP not found in intelligence database
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /profanity/filter:
    get:
      tags:
        - Profanity
      operationId: profanityFilter
      summary: Filter profanity from text
      description: Replaces profane words with asterisks. Returns cleaned text.
      parameters:
        - name: text
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Filtered text
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                original: what a damn mess
                filtered: what a **** mess
                matches: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /profanity/detect:
    get:
      tags:
        - Profanity
      operationId: profanityDetect
      summary: Detect whether text contains profanity
      parameters:
        - name: text
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Detection result (contains, word count)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                text: what a damn mess
                hasProfanity: true
                severity: mild
                matchCount: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /profanity/analyze:
    get:
      tags:
        - Profanity
      operationId: profanityAnalyze
      summary: Comprehensive profanity analysis with severity and word positions
      parameters:
        - name: text
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Detailed analysis with severity score, word positions, and categories
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                text: what a damn mess
                hasProfanity: true
                severity: mild
                score: 0.32
                matches:
                  - word: damn
                    category: profanity
                    severity: mild
                    start: 7
                    end: 11
                summary:
                  totalMatches: 1
                  categories:
                    - profanity
                  profanityDetected: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data/batch:
    get:
      tags:
        - Sample Data
      operationId: sampleDataBatchGet
      summary: Generate multiple types of sample data (GET)
      description: >
        Generates mock data using Faker.js. Supports 36 schema types including user, address, company, product,
        and more. Use the requests parameter as a JSON-encoded array.
      parameters:
        - name: requests
          in: query
          required: true
          description: JSON-encoded array of generation requests [{type, count, fields?}]
          schema:
            type: string
            example: "[{\"type\":\"user\",\"count\":5}]"
      responses:
        "200":
          description: Generated data records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - type: user
                    count: 3
                    data:
                      - name: Ada Lovelace
                        email: ada@example.com
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Sample Data
      operationId: sampleDataBatchPost
      summary: Generate multiple types of sample data (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - requests
              properties:
                requests:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - count
                    properties:
                      type:
                        type: string
                        description: Schema type (user, address, company, product, etc.)
                        example: user
                      count:
                        type: integer
                        minimum: 1
                        maximum: 1000
                        example: 10
                      fields:
                        type: array
                        items:
                          type: string
                        description: Specific fields to include. Returns all fields if omitted.
            example:
              requests:
                - type: user
                  count: 10
                - type: company
                  count: 5
      responses:
        "200":
          description: Generated data records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - type: user
                    count: 10
                    data:
                      - name: Ada Lovelace
                        email: ada@example.com
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unit-conversion/convert:
    get:
      tags:
        - Unit Conversion
      operationId: unitConvertGet
      summary: Convert a value between units
      description: >
        Supports 100+ unit types across length, weight, temperature, volume, area, speed, digital storage, and time.
        Converts value from source unit to target unit.
      parameters:
        - name: from
          in: query
          required: true
          description: Source unit identifier (e.g. kg, lb, m, degC, km/h)
          schema:
            type: string
            example: kg
        - name: to
          in: query
          required: true
          description: Target unit identifier
          schema:
            type: string
            example: lb
        - name: value
          in: query
          required: true
          schema:
            type: number
            example: 10
        - name: precision
          in: query
          required: false
          description: Decimal places in result (0-15)
          schema:
            type: integer
            minimum: 0
            maximum: 15
            default: 4
      responses:
        "200":
          description: Conversion result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                from: cm
                to: in
                value: 100
                result: 39.37
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Unit Conversion
      operationId: unitConvertPost
      summary: Convert a value between units (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - value
              properties:
                from:
                  type: string
                  example: kg
                to:
                  type: string
                  example: lb
                value:
                  type: number
                  example: 10
                precision:
                  type: integer
                  minimum: 0
                  maximum: 15
            example:
              value: 100
              from: meters
              to: feet
              precision: 2
      responses:
        "200":
          description: Conversion result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                from: cm
                to: in
                value: 100
                result: 39.37
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unit-conversion/categories:
    get:
      tags:
        - Unit Conversion
      operationId: unitCategories
      summary: List available measurement categories
      responses:
        "200":
          description: Category list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                categories:
                  - length
                  - mass
                  - temperature
                  - area
                  - volume
                  - speed
                  - time
                  - data
                count: 8
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unit-conversion/units/{category}:
    get:
      tags:
        - Unit Conversion
      operationId: unitsByCategory
      summary: List units available in a category
      parameters:
        - name: category
          in: path
          required: true
          description: Measurement category (e.g. length, weight, temperature)
          schema:
            type: string
            example: length
      responses:
        "200":
          description: Unit list for the category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                category: length
                units:
                  - meters
                  - feet
                  - miles
                  - kilometers
                  - inches
                  - centimeters
                  - yards
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /user-avatar:
    get:
      tags:
        - User Avatar
      operationId: userAvatarGenerate
      summary: Generate a customizable user avatar image
      description: >
        Creates avatar images using Canvas (PNG/WebP) or native SVG. Supports initials-based avatars, custom colors,
        external image integration, and uploaded icons.
      parameters:
        - name: name
          in: query
          required: false
          description: Display name to generate initials from
          schema:
            type: string
            example: John Doe
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum:
              - png
              - webp
              - svg
            default: png
        - name: size
          in: query
          required: false
          description: Avatar size in pixels (16–512)
          schema:
            type: integer
            minimum: 16
            maximum: 512
            default: 128
        - name: background
          in: query
          required: false
          description: Background color hex without
          schema:
            type: string
            pattern: ^[0-9A-Fa-f]{6}$
            example: 4A90D9
        - name: color
          in: query
          required: false
          description: Text/icon color hex without
          schema:
            type: string
            pattern: ^[0-9A-Fa-f]{6}$
            example: FFFFFF
        - name: rounded
          in: query
          required: false
          description: Output a circular avatar
          schema:
            type: boolean
            default: false
      responses:
        "200":
          description: Avatar image binary or SVG markup
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/svg+xml:
              schema:
                type: string
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /user-avatar/upload-icon:
    post:
      tags:
        - User Avatar
      operationId: userAvatarUploadIcon
      summary: Upload a custom icon for avatar generation
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Icon image file (PNG, SVG, or WebP, max 1MB)
      responses:
        "200":
          description: Upload confirmation with icon ID
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                url: https://datpaq.com/avatars/abc123.png
                id: abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /validate-ip/validate:
    get:
      tags:
        - Validate IP
      operationId: validateIpGet
      summary: Validate and classify IP addresses
      description: >
        Validates IPv4, IPv6, or CIDR notation and returns classification flags: private, reserved, loopback, multicast,
        link-local, bogon, and public. Supports comma-separated batch input (max 100).
      parameters:
        - name: ip
          in: query
          required: true
          description: Single IP, CIDR notation, or comma-separated list (max 100)
          schema:
            type: string
            example: 8.8.8.8
      responses:
        "200":
          description: Validation and classification results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                ip: 192.168.1.1
                valid: true
                type: IPv4
                private: true
                message: Valid IPv4 address (private)
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Validate IP
      operationId: validateIpPost
      summary: Validate and classify IP addresses (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ip
              properties:
                ip:
                  description: Single IP string or array of IPs
                  oneOf:
                    - type: string
                      example: 8.8.8.8
                    - type: array
                      items:
                        type: string
                      maxItems: 100
            example:
              ips:
                - 8.8.8.8
                - 192.168.1.1
                - 127.0.0.1
                - bad.ip
      responses:
        "200":
          description: Validation results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                - ip: 8.8.8.8
                  valid: true
                - ip: 127.0.0.1
                  valid: true
                - ip: bad.ip
                  valid: false
                  error: Invalid IP address
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-screenshot:
    get:
      tags:
        - Web Screenshot
      operationId: webScreenshot
      summary: Capture a screenshot of a web page
      description: >
        Renders a web page via Puppeteer headless browser and returns a screenshot. Supports viewport simulation, format
        selection, quality control, and crop.
      parameters:
        - name: url
          in: query
          required: true
          description: Target URL including http/https scheme
          schema:
            type: string
            format: uri
            example: https://example.com
        - name: width
          in: query
          required: false
          description: Viewport width in pixels (100–3840, default 1280)
          schema:
            type: integer
            minimum: 100
            maximum: 3840
            default: 1280
        - name: height
          in: query
          required: false
          description: Viewport height in pixels (100–2160, default 800)
          schema:
            type: integer
            minimum: 100
            maximum: 2160
            default: 800
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum:
              - jpeg
              - png
              - webp
            default: jpeg
        - name: quality
          in: query
          required: false
          description: Image quality (10–100, default 100; ignored for PNG)
          schema:
            type: integer
            minimum: 10
            maximum: 100
            default: 100
        - name: crop
          in: query
          required: false
          description: Crop dimensions as WIDTHxHEIGHT (e.g. 800x600)
          schema:
            type: string
            example: 800x600
      responses:
        "200":
          description: Screenshot image binary
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /whois/lookup:
    post:
      tags:
        - WHOIS
      operationId: whoisLookup
      summary: Perform WHOIS lookup for one or multiple domains
      description: >
        Returns registrar, registration date, expiration date, name servers, and raw WHOIS data. Supports single domain
        or batch array (max 50).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  description: Single domain string or array (max 50)
                  oneOf:
                    - type: string
                      example: example.com
                    - type: array
                      items:
                        type: string
                      maxItems: 50
            example:
              domain: openai.com
      responses:
        "200":
          description: WHOIS registration data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                fromCache: true
                domain: openai.com
                tld: com
                registrar: MarkMonitor Inc.
                creationDate: "2015-04-15T00:00:00Z"
                expirationDate: "2026-04-15T00:00:00Z"
                nameServers:
                  - ns1.openai.com
                  - ns2.openai.com
                registrantRedacted: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /working-days/calculate:
    post:
      tags:
        - Working Days
      operationId: workingDaysCalculatePost
      summary: Calculate working days between dates or offset business days
      description: >
        For range calculations: provide start_date and end_date to get the number of working days between them. For
        offset calculations: provide start_date and days_offset to find the resulting business date. Supports US, DE,
        and IN regional holiday calendars.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - start_date
              properties:
                start_date:
                  type: string
                  format: date
                  example: "2026-01-01"
                end_date:
                  type: string
                  format: date
                  example: "2026-01-31"
                days_offset:
                  type: integer
                  description: Working days to add (positive) or subtract (negative)
                  example: 10
                direction:
                  type: string
                  enum:
                    - forward
                    - backward
                  default: forward
                region:
                  type: string
                  description: Regional holiday calendar
                  enum:
                    - US
                    - DE
                    - IN
                  default: US
            example:
              start_date: "2026-07-01"
              end_date: "2026-07-15"
              region: US
      responses:
        "200":
          description: Working day calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                working_days: 7
                start_date: "2025-07-01"
                end_date: "2025-07-10"
                region: US
                holidays_used:
                  - "2025-07-04"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    get:
      tags:
        - Working Days
      operationId: workingDaysCalculateGet
      summary: Calculate working days (GET)
      parameters:
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
            example: "2026-01-01"
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: days_offset
          in: query
          required: false
          schema:
            type: integer
        - name: region
          in: query
          required: false
          schema:
            type: string
            enum:
              - US
              - DE
              - IN
            default: US
      responses:
        "200":
          description: Working day calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                working_days: 7
                start_date: "2025-07-01"
                end_date: "2025-07-10"
                region: US
                holidays_used:
                  - "2025-07-04"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /working-days/calculate/batch:
    get:
      tags:
        - Working Days
      operationId: workingDaysBatch
      summary: Batch working day calculations
      parameters:
        - name: requests
          in: query
          required: true
          description: JSON-encoded array of calculation requests
          schema:
            type: string
            example: "[{\"start_date\":\"2026-01-01\",\"end_date\":\"2026-01-31\"}]"
      responses:
        "200":
          description: Batch calculation results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                - working_days: 7
                  start_date: "2025-07-01"
                  end_date: "2025-07-10"
                  region: US
                - working_days: 5
                  start_date: "2025-08-01"
                  end_date: "2025-08-08"
                  region: US
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data/generate:
    post:
      tags:
        - Sample Data
      operationId: sampleDataGeneratePost
      summary: Generate sample data
      description: >-
        Generate realistic mock data using a JSON request body. Recommended for full control over type, count, fields,
        and format.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  description: Schema type to generate, such as user, company, product, or transaction.
                count:
                  type: integer
                  minimum: 1
                  maximum: 10000
                  default: 10
                fields:
                  type: array
                  items:
                    type: string
                  description: Optional field names to include.
                format:
                  type: string
                  enum:
                    - json
                    - csv
                  default: json
            example:
              type: user
              count: 5
              fields:
                - name
                - email
                - phone
      responses:
        "200":
          description: Generated sample data records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                type: user
                count: 3
                data:
                  - name: John Doe
                    email: john@example.com
                    phone: +1-555-0123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data/generate-batch:
    post:
      tags:
        - Sample Data
      operationId: sampleDataGenerateBatchPost
      summary: Generate multiple sample datasets
      description: Submit multiple sample-data generation requests in one call.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - requests
              properties:
                requests:
                  type: array
                  maxItems: 10
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                      count:
                        type: integer
                        minimum: 1
                        maximum: 1000
                        default: 10
                      fields:
                        type: array
                        items:
                          type: string
                      format:
                        type: string
                        enum:
                          - json
                          - csv
                        default: json
            example:
              requests:
                - type: user
                  count: 2
                - type: company
                  count: 3
      responses:
        "200":
          description: Generated data records grouped by request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - type: user
                    count: 2
                    data:
                      - name: Ada Lovelace
                        email: ada@example.com
                  - type: company
                    count: 1
                    data:
                      - name: Globex
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data:
    get:
      tags:
        - Sample Data
      operationId: sampleDataGenerateGet
      summary: Generate sample data with query parameters
      description: GET-compatible sample data generation endpoint for scripts and browser testing.
      parameters:
        - name: type
          in: query
          required: true
          description: Schema type to generate, such as user, company, product, or transaction.
          schema:
            type: string
        - name: count
          in: query
          required: false
          description: Number of records to generate.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
            default: 10
        - name: fields
          in: query
          required: false
          description: Comma-separated list of fields to include. Any supported field works with any type; list them with GET /sample-data/fields. Unknown fields are ignored.
          schema:
            type: string
        - name: format
          in: query
          required: false
          description: Response format.
          schema:
            type: string
            enum:
              - json
              - csv
            default: json
      responses:
        "200":
          description: Generated sample data records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                type: user
                count: 3
                data:
                  - name: John Doe
                    email: john@example.com
                    phone: +1-555-0123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data/schemas:
    get:
      tags:
        - Sample Data
      operationId: sampleDataSchemas
      summary: List sample data schemas
      description: Returns all available sample-data schema names with default field lists.
      responses:
        "200":
          description: Available sample-data schemas
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                schemas:
                  - user
                  - company
                  - product
                  - transaction
                  - address
                count: 5
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sample-data/fields:
    get:
      tags:
        - Sample Data
      operationId: sampleDataFields
      summary: List supported sample data fields
      description: Returns every field name accepted by the `fields` parameter, or, when `type` is given, that schema's default fields.
      parameters:
        - name: type
          in: query
          required: false
          description: Schema type, such as user, company, product, or transaction. Omit to list all supported fields.
          schema:
            type: string
      responses:
        "200":
          description: Supported field names
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  type: user
                  totalFields: 5
                  fields:
                    - name
                    - email
                    - phone
                    - dob
                    - gender
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ip-intelligence/batch/info:
    get:
      tags:
        - IP Intelligence
      operationId: ipIntelligenceBatchInfo
      summary: Get IP intelligence batch configuration
      description: Returns batch processing limits, example request shape, and response schema details.
      responses:
        "200":
          description: Batch processing configuration
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                maxBatchSize: 100
                supportedFormats:
                  - ipv4
                  - ipv6
                rateLimit: per-key
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /image-processing/info:
    get:
      tags:
        - Image Processing
      operationId: imageProcessingInfo
      summary: Get image processing service information
      description: Returns supported image operations, formats, and service metadata.
      responses:
        "200":
          description: Image processing service information
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                operations:
                  - resize
                  - compress
                  - convert
                  - crop
                  - metadata
                maxFileSize: 10MB
                supportedFormats:
                  - jpeg
                  - png
                  - webp
                  - avif
                  - heic
                  - heif
                  - svg
                  - gif
                  - tiff
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /mac-address:
    get:
      tags:
        - MAC Address
      operationId: macAddressLookup
      summary: Resolve MAC address vendor and manufacturer
      description: >
        Lookup vendor by full MAC address, 6-character OUI prefix, or organization name. Provide exactly one of mac,
        prefix, or org.
      parameters:
        - name: mac
          in: query
          required: false
          description: Full MAC address (colon, hyphen, or compact hex)
          schema:
            type: string
            example: "00:11:22:33:44:55"
        - name: prefix
          in: query
          required: false
          description: 6-character hex OUI prefix
          schema:
            type: string
            example: "001122"
        - name: org
          in: query
          required: false
          description: Organization name search (min 2 chars, max 50 results)
          schema:
            type: string
            example: Apple
      responses:
        "200":
          description: Vendor information
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                - prefix: 00:1A:2B
                  organization: Cisco Systems
                  registry: MA-L
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /dns-lookup:
    get:
      tags:
        - DNS Lookup
      operationId: dnsLookup
      summary: Resolve DNS records for domains or reverse PTR for IPs
      description: >
        Forward DNS for A, AAAA, MX, TXT, NS, CNAME, and SOA records. Reverse lookup via ip for PTR. Batch domains by
        repeating the domain parameter. Default record type is A; use ALL for every supported type.
      parameters:
        - name: domain
          in: query
          required: false
          description: Domain to resolve (repeat for batch)
          schema:
            oneOf:
              - type: string
                example: example.com
              - type: array
                items:
                  type: string
        - name: ip
          in: query
          required: false
          description: IP address for reverse PTR lookup
          schema:
            type: string
            example: 8.8.8.8
        - name: type
          in: query
          required: false
          description: DNS record type
          schema:
            type: string
            enum:
              - A
              - AAAA
              - MX
              - TXT
              - NS
              - CNAME
              - SOA
              - PTR
              - ALL
            default: A
      responses:
        "200":
          description: DNS record results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                - domain: example.com
                  records:
                    MX:
                      - exchange: mail.example.com
                        priority: 10
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /domain-lookup:
    post:
      tags:
        - Domain Lookup
      operationId: domainLookupPost
      summary: Enrich domains with TLD metadata and DNS presence flags
      description: >
        Returns TLD category, region, dnsCheck booleans, and WHOIS link metadata. Single domain returns an object; batch
        array (max 50) returns an array. Invalid domains return per-item errors without failing the batch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domain
              properties:
                domain:
                  description: Single domain string or array (max 50)
                  oneOf:
                    - type: string
                      example: stripe.com
                    - type: array
                      items:
                        type: string
                      maxItems: 50
            example:
              domain: stripe.com
      responses:
        "200":
          description: Domain enrichment data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                domain: stripe.com
                tld: com
                category: commercial
                region: Global
                dnsCheck:
                  hasA: true
                  hasAAAA: true
                  hasMX: true
                  hasTXT: true
                whois:
                  available: true
                  url: https://datpaq.com/whois?domain=stripe.com
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /mx-lookup:
    get:
      tags:
        - MX Lookup
      operationId: mxLookupGet
      summary: Look up MX records for one or more domains (GET)
      description: |
        Returns priority-sorted MX records with optional IP resolution, SMTP port 25 checks, and SPF parsing.
      parameters:
        - name: domains
          in: query
          required: true
          description: >
            Domains to check. Note the parameter name is plural (`domains`, not `domain`), even for a single domain.
            Accepts one domain or a comma-separated list (max 50).
          schema:
            type: string
            example: gmail.com
        - name: resolveIps
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: validateSmtp
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: includeSpf
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        "200":
          description: MX lookup results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                - domain: gmail.com
                  mxRecords:
                    - priority: 5
                      exchange: gmail-smtp-in.l.google.com
                      ipAddresses:
                        - 142.250.102.27
                      smtpOpen: true
                  spf:
                    record: v=spf1 include:_spf.google.com ~all
                    includes:
                      - _spf.google.com
                    mechanism: ~all
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - MX Lookup
      operationId: mxLookupPost
      summary: Look up MX records for one or more domains (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - domains
              properties:
                domains:
                  oneOf:
                    - type: string
                      example: gmail.com
                    - type: array
                      items:
                        type: string
                      maxItems: 50
                resolveIps:
                  type: boolean
                  default: true
                validateSmtp:
                  type: boolean
                  default: false
                includeSpf:
                  type: boolean
                  default: false
            example:
              domains:
                - gmail.com
                - protonmail.com
              resolveIps: true
              validateSmtp: true
              includeSpf: true
      responses:
        "200":
          description: MX lookup results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                count: 2
                data:
                  - domain: gmail.com
                    mxRecords:
                      - priority: 5
                        exchange: gmail-smtp-in.l.google.com
                  - domain: protonmail.com
                    mxRecords:
                      - priority: 10
                        exchange: mail.protonmail.ch
                processingTime: 12ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /dictionary:
    get:
      tags:
        - Dictionary
      operationId: dictionaryDefineGet
      summary: Look up an English word definition (GET)
      description: |
        Returns phonetic transcription, parts of speech, definitions, and usage examples for a single word.
      parameters:
        - name: word
          in: query
          required: true
          description: English word to define
          schema:
            type: string
            example: example
      responses:
        "200":
          description: Word definition payload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                word: example
                phonetic: IH0 G Z AE1 M P AH0 L
                meanings:
                  - partOfSpeech: noun
                    definition: A representative form or pattern.
                    example: This sentence is an example of correct usage.
                synonyms:
                  - sample
                  - instance
                antonyms: []
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Dictionary
      operationId: dictionaryDefinePost
      summary: Look up an English word definition (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - word
              properties:
                word:
                  type: string
                  example: serendipity
            example:
              word: example
      responses:
        "200":
          description: Word definition payload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                word: example
                phonetic: IH0 G Z AE1 M P AH0 L
                meanings:
                  - partOfSpeech: noun
                    definition: A representative form or pattern.
                    example: This sentence is an example of correct usage.
                synonyms:
                  - sample
                  - instance
                antonyms: []
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /dictionary/batch:
    get:
      tags:
        - Dictionary
      operationId: dictionaryDefineBatchGet
      summary: Look up multiple word definitions (GET)
      parameters:
        - name: words
          in: query
          required: true
          description: Comma-separated list of words
          schema:
            type: string
            example: example,dictionary
      responses:
        "200":
          description: Batch definition results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                results:
                  - word: example
                    meanings:
                      - partOfSpeech: noun
                        definition: A representative form or pattern
                  - word: dictionary
                    meanings:
                      - partOfSpeech: noun
                        definition: A reference book of word meanings
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Dictionary
      operationId: dictionaryDefineBatchPost
      summary: Look up multiple word definitions (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - word
              properties:
                word:
                  type: array
                  items:
                    type: string
                  maxItems: 50
            example:
              word:
                - example
                - dictionary
      responses:
        "200":
          description: Batch definition results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                results:
                  - word: example
                    meanings:
                      - partOfSpeech: noun
                        definition: A representative form or pattern
                  - word: dictionary
                    meanings:
                      - partOfSpeech: noun
                        definition: A reference book of word meanings
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /dictionary/suggest:
    get:
      tags:
        - Dictionary
      operationId: dictionarySuggest
      summary: Fuzzy word suggestions
      parameters:
        - name: q
          in: query
          required: true
          description: Partial or misspelled query
          schema:
            type: string
            example: exampl
      responses:
        "200":
          description: Suggested word matches
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                suggestions:
                  - example
                  - examples
                  - exemplary
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /spell-check:
    get:
      tags:
        - Spell Check
      operationId: spellCheckGet
      summary: Spell-check text (GET)
      parameters:
        - name: text
          in: query
          required: true
          description: Text to check (max 10,000 characters)
          schema:
            type: string
            example: Hello wrold, this is a tets
        - name: language
          in: query
          required: false
          schema:
            type: string
            enum:
              - en
              - es
              - fr
              - de
              - it
            default: en
        - name: suggestions
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: includeGrammar
          in: query
          required: false
          schema:
            type: boolean
            default: true
      responses:
        "200":
          description: Spelling and grammar results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                language: en
                issues:
                  - word: wrold
                    suggestions:
                      - world
                  - word: tets
                    suggestions:
                      - tests
                      - test
                suggestions:
                  wrold:
                    - world
                  tets:
                    - tests
                    - test
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Spell Check
      operationId: spellCheckPost
      summary: Spell-check text (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                language:
                  type: string
                  enum:
                    - en
                    - es
                    - fr
                    - de
                    - it
                  default: en
                suggestions:
                  type: boolean
                  default: true
                includeGrammar:
                  type: boolean
                  default: true
            example:
              text: helo frend
              lang: en
              suggestions: true
      responses:
        "200":
          description: Spelling and grammar results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                language: en
                issues:
                  - word: wrold
                    suggestions:
                      - world
                  - word: tets
                    suggestions:
                      - tests
                      - test
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /spell-check/languages:
    get:
      tags:
        - Spell Check
      operationId: spellCheckLanguages
      summary: List supported spell-check languages
      responses:
        "200":
          description: Supported language list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                languages:
                  - code: en
                    name: English
                  - code: es
                    name: Spanish
                  - code: fr
                    name: French
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /text-language/detect:
    get:
      tags:
        - Text Language
      operationId: textLanguageDetectGet
      summary: Detect language of text (GET)
      parameters:
        - name: text
          in: query
          required: true
          schema:
            type: string
            example: Bonjour, comment allez-vous aujourd'hui?
        - name: top
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum:
              - iso639-3
              - iso639-1
            default: iso639-3
      responses:
        "200":
          description: Detected language candidate(s)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                languageCode: fr
                languageName: French
                confidence: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Text Language
      operationId: textLanguageDetectPost
      summary: Detect language of text (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                top:
                  type: integer
                  default: 1
                format:
                  type: string
                  enum:
                    - iso639-3
                    - iso639-1
                  default: iso639-3
            example:
              text: Ceci est un exemple de texte en franÃ§ais.
              top: 1
              format: 639-1
      responses:
        "200":
          description: Detected language candidate(s)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                languageCode: fr
                languageName: French
                confidence: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /text-language/detect/batch:
    post:
      tags:
        - Text Language
      operationId: textLanguageDetectBatch
      summary: Batch language detection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  maxItems: 50
                  items:
                    type: object
                    required:
                      - text
                    properties:
                      id:
                        type: string
                      text:
                        type: string
            example:
              items:
                - id: "1"
                  text: Hello world
                - id: "2"
                  text: Hola mundo
      responses:
        "200":
          description: Per-item language detection results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                results:
                  - id: "1"
                    language: eng
                    confidence: 0.99
                  - id: "2"
                    language: spa
                    confidence: 0.98
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /text-language/languages:
    get:
      tags:
        - Text Language
      operationId: textLanguageLanguages
      summary: List supported languages
      responses:
        "200":
          description: Supported language catalog
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                languages:
                  - code: eng
                    name: English
                    iso6391: en
                  - code: fra
                    name: French
                    iso6391: fr
                count: 97
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/lookup/{word}:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusLookup
      summary: Full thesaurus lookup for a word
      parameters:
        - name: word
          in: path
          required: true
          schema:
            type: string
            example: happy
      responses:
        "200":
          description: Synonyms, antonyms, and related terms
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                query:
                  term: fast
                  relation: synonym
                  limit: 5
                results:
                  - term: quick
                    pos: adj
                  - term: rapid
                    pos: adj
                page:
                  limit: 5
                  offset: 0
                  total_estimate: 4
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/synonyms/{word}:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusSynonyms
      summary: Synonyms for a word
      parameters:
        - name: word
          in: path
          required: true
          schema:
            type: string
            example: happy
      responses:
        "200":
          description: Synonym list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                word: happy
                synonyms:
                  - joyful
                  - cheerful
                  - content
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/antonyms/{word}:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusAntonyms
      summary: Antonyms for a word
      parameters:
        - name: word
          in: path
          required: true
          schema:
            type: string
            example: happy
      responses:
        "200":
          description: Antonym list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                word: happy
                antonyms:
                  - sad
                  - unhappy
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/related/{word}:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusRelated
      summary: Related terms for a word
      parameters:
        - name: word
          in: path
          required: true
          schema:
            type: string
            example: happy
      responses:
        "200":
          description: Related-term list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                word: happy
                related:
                  - smile
                  - joy
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/search:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusSearch
      summary: Substring search across thesaurus vocabulary
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            example: happ
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 10
      responses:
        "200":
          description: Matching words
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                query: happ
                results:
                  - happy
                  - happen
                  - happiness
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /thesaurus/batch:
    get:
      tags:
        - Thesaurus
      operationId: thesaurusBatchGet
      summary: Batch thesaurus lookup (GET)
      parameters:
        - name: words
          in: query
          required: true
          description: Comma-separated words (max 100)
          schema:
            type: string
            example: happy,sad,fast
      responses:
        "200":
          description: Batch thesaurus results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                results:
                  - word: happy
                    data:
                      synonyms:
                        - joyful
                  - word: sad
                    data:
                      synonyms:
                        - unhappy
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Thesaurus
      operationId: thesaurusBatchPost
      summary: Batch thesaurus lookup (POST)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - words
              properties:
                words:
                  type: array
                  items:
                    type: string
                  maxItems: 100
            example:
              words:
                - happy
                - sad
                - fast
      responses:
        "200":
          description: Batch thesaurus results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                results:
                  - word: happy
                    data:
                      synonyms:
                        - joyful
                  - word: sad
                    data:
                      synonyms:
                        - unhappy
                  - word: fast
                    data:
                      synonyms:
                        - quick
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/scrape:
    post:
      tags:
        - Web Scraping
      operationId: webScrapingScrape
      summary: Synchronously scrape a public URL
      description: >
        Returns page content in the requested formats. SSRF-guarded. Default format is markdown with Readability
        main-content extraction enabled.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  example: https://example.com/article
                formats:
                  type: array
                  items:
                    type: string
                    enum:
                      - markdown
                      - html
                      - rawHtml
                      - links
                      - images
                      - screenshot
                  default:
                    - markdown
                onlyMainContent:
                  type: boolean
                  default: true
                waitUntil:
                  type: string
                  enum:
                    - load
                    - domcontentloaded
                    - networkidle0
                    - networkidle2
                  default: domcontentloaded
                waitFor:
                  type: integer
                  minimum: 0
                  maximum: 10000
                  default: 0
                includeTags:
                  type: array
                  items:
                    type: string
                excludeTags:
                  type: array
                  items:
                    type: string
            example:
              url: https://example.com/article
              formats:
                - markdown
      responses:
        "200":
          description: Scraped page content
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                url: https://example.com/article
                title: Article Title
                text: Plain text content...
                excerpt: Summary...
                byline: null
                siteName: Example
                length: 1200
                content: <article>...</article>
                markdown: |-
                  # Article Title

                  Plain text content...
                metadata:
                  timingMs: 3500
                  cached: false
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/batch/scrape:
    post:
      tags:
        - Web Scraping
      operationId: webScrapingBatchStart
      summary: Start an async batch scrape job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - urls
              properties:
                urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  minItems: 1
                  maxItems: 100
                formats:
                  type: array
                  items:
                    type: string
            example:
              urls:
                - https://a.example.com
                - https://b.example.com
              formats:
                - markdown
      responses:
        "202":
          description: Batch job accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                id: batch_01HXYZ
                status: queued
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/batch/scrape/{id}:
    get:
      tags:
        - Web Scraping
      operationId: webScrapingBatchStatus
      summary: Poll an async batch scrape job
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
      responses:
        "200":
          description: Batch job status and results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                id: batch_01HXYZ
                status: completed
                completed: 2
                failed: 0
                results:
                  - url: https://a.example.com
                    title: A
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/crawl:
    post:
      tags:
        - Web Scraping
      operationId: webScrapingCrawlStart
      summary: Start an async site crawl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                limit:
                  type: integer
                maxDepth:
                  type: integer
                includePaths:
                  type: array
                  items:
                    type: string
                excludePaths:
                  type: array
                  items:
                    type: string
            example:
              url: https://example.com
              limit: 25
              maxDepth: 2
      responses:
        "202":
          description: Crawl job accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                id: crawl_01HXYZ
                status: queued
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/crawl/{id}:
    get:
      tags:
        - Web Scraping
      operationId: webScrapingCrawlStatus
      summary: Poll an async crawl job
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Crawl progress and page results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                id: crawl_01HXYZ
                status: completed
                pages: 12
                results:
                  - url: https://example.com
                    title: Home
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /web-scraping/map:
    post:
      tags:
        - Web Scraping
      operationId: webScrapingMap
      summary: Discover links reachable from a URL
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
            example:
              url: https://example.com
      responses:
        "200":
          description: Discovered URL map
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                url: https://example.com
                links:
                  - https://example.com/about
                  - https://example.com/docs
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /aircraft/lookup:
    get:
      tags:
        - Aircraft
      operationId: aircraftLookup
      summary: Look up aircraft by FAA tail number
      description: Requires tail. Returns FAA registration details for the N-number.
      responses:
        "200":
          description: Aircraft registration details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  valid: true
                  tail: N172SP
                  manufacturer: CESSNA
                  model: 172S
                  year: 2001
                  owner: EXAMPLE AVIATION LLC
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 18ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: tail
          in: query
          required: true
          description: FAA N-number / tail
          schema:
            type: string
            example: N172SP
  /aircraft/icao/{hex}:
    get:
      tags:
        - Aircraft
      operationId: aircraftIcaoLookup
      summary: Look up aircraft by ICAO hex
      description: Resolves a 6-character ICAO Mode S hex code.
      responses:
        "200":
          description: Aircraft record for the ICAO hex
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  hex: A4B5C6
                  tail: N172SP
                  manufacturer: CESSNA
                  model: 172S
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 22ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: hex
          in: path
          required: true
          description: ICAO hex
          schema:
            type: string
            example: A4B5C6
  /aircraft/type/{code}:
    get:
      tags:
        - Aircraft
      operationId: aircraftTypeLookup
      summary: Look up aircraft type code
      description: Returns type identification and specifications for an aircraft type code.
      responses:
        "200":
          description: Aircraft type details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  code: C172
                  manufacturer: CESSNA
                  model: "172"
                  category: Land Plane
                  seating: 4
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: code
          in: path
          required: true
          description: Aircraft type code
          schema:
            type: string
            example: C172
  /aircraft/batch:
    post:
      tags:
        - Aircraft
      operationId: aircraftBatch
      summary: Batch aircraft lookups
      description: "JSON array or { items: [...] }, up to 50 tail lookups."
      responses:
        "200":
          description: Batch lookup results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  results:
                    - tail: N172SP
                      valid: true
                      manufacturer: CESSNA
                      model: 172S
                    - tail: N628TS
                      valid: true
                      manufacturer: CESSNA
                      model: 182T
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 41ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: Batch items
        content:
          application/json:
            schema:
              type: object
              required: []
              properties:
                items:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                    example: N172SP
            example:
              items:
                - N172SP
                - N628TS
  /calendar/month:
    get:
      tags:
        - Calendar
      operationId: calendarMonth
      summary: Month calendar
      description: Requires year and month. Returns BI-friendly date attributes, flat or nested by week.
      responses:
        "200":
          description: Month calendar structure
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  year: 2026
                  month: 8
                  days:
                    - date: "2026-08-20"
                      weekday: Thursday
                      isWeekend: false
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 11ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: year
          in: query
          required: true
          description: Calendar year
          schema:
            type: integer
            example: 2026
        - name: month
          in: query
          required: true
          description: Month 1-12
          schema:
            type: integer
            example: 8
        - name: week_start
          in: query
          required: false
          description: Week start
          schema:
            type: string
            enum:
              - sunday
              - monday
            example: monday
        - name: timezone
          in: query
          required: false
          description: IANA timezone
          schema:
            type: string
            example: UTC
        - name: include_holidays
          in: query
          required: false
          description: Overlay public holidays
          schema:
            type: boolean
            example: false
        - name: country_code
          in: query
          required: false
          description: ISO2 country for public holidays
          schema:
            type: string
            example: US
        - name: output_format
          in: query
          required: false
          description: flat or nested
          schema:
            type: string
            enum:
              - flat
              - nested
            example: nested
  /calendar/day:
    get:
      tags:
        - Calendar
      operationId: calendarDay
      summary: Single day attributes
      description: Requires date (YYYY-MM-DD). Returns attributes for one date with optional holidays.
      responses:
        "200":
          description: Day calendar attributes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  date: "2026-08-20"
                  weekday: Thursday
                  isWeekend: false
                  holidays: []
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 7ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: date
          in: query
          required: true
          description: ISO date
          schema:
            type: string
            example: "2026-08-20"
        - name: include_holidays
          in: query
          required: false
          description: Overlay public holidays
          schema:
            type: boolean
            example: false
        - name: country_code
          in: query
          required: false
          description: ISO2 country for public holidays
          schema:
            type: string
            example: US
  /calendar/range:
    get:
      tags:
        - Calendar
      operationId: calendarRange
      summary: Date range calendar
      description: Requires start_date and end_date. Span cannot exceed 366 days.
      responses:
        "200":
          description: Date-range calendar rows
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  start_date: "2026-08-01"
                  end_date: "2026-08-31"
                  days:
                    - date: "2026-08-01"
                      weekday: Saturday
                      isWeekend: true
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 14ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: start_date
          in: query
          required: true
          description: Range start YYYY-MM-DD
          schema:
            type: string
            example: "2026-08-01"
        - name: end_date
          in: query
          required: true
          description: Range end YYYY-MM-DD
          schema:
            type: string
            example: "2026-08-31"
        - name: include_weekends
          in: query
          required: false
          description: Include Saturday and Sunday
          schema:
            type: boolean
            example: true
        - name: include_holidays
          in: query
          required: false
          description: Overlay public holidays
          schema:
            type: boolean
            example: false
        - name: country_code
          in: query
          required: false
          description: ISO2 country for public holidays
          schema:
            type: string
            example: US
  /calendar/holidays:
    get:
      tags:
        - Calendar
      operationId: calendarHolidays
      summary: Holiday overlay for a year
      description: Requires year. country_code is required when holiday_sources includes public.
      responses:
        "200":
          description: Holiday rows for the year
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  year: 2026
                  country_code: US
                  holidays:
                    - date: "2026-12-25"
                      name: Christmas Day
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: year
          in: query
          required: true
          description: Calendar year
          schema:
            type: integer
            example: 2026
        - name: month
          in: query
          required: false
          description: Optional month 1-12
          schema:
            type: integer
            example: 12
        - name: country_code
          in: query
          required: false
          description: ISO2 country
          schema:
            type: string
            example: US
  /country-codes/countries:
    get:
      tags:
        - Country Codes
      operationId: countryCodesList
      summary: List all countries
      description: All ISO 3166-1 countries sorted by name, with ISO2, ISO3, and numeric codes.
      responses:
        "200":
          description: Country list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - name: United States
                    iso2: US
                    iso3: USA
                    numeric: "840"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 12ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /country-codes/countries/search:
    get:
      tags:
        - Country Codes
      operationId: countryCodesSearch
      summary: Search countries
      description: Requires q. Matches name, ISO2, ISO3, or numeric code. Limited to 25 rows.
      responses:
        "200":
          description: Matching countries
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - name: United States
                    iso2: US
                    iso3: USA
                    numeric: "840"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 10ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: q
          in: query
          required: true
          description: Search text
          schema:
            type: string
            example: united
  /country-codes/countries/match:
    get:
      tags:
        - Country Codes
      operationId: countryCodesMatch
      summary: Exact or fuzzy country match
      description: Requires q. Tries exact ISO/numeric match, then PostgreSQL similarity on the country name.
      responses:
        "200":
          description: Best country match
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  name: United States
                  iso2: US
                  iso3: USA
                  numeric: "840"
                  similarity: 0.91
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: q
          in: query
          required: true
          description: Code or country name
          schema:
            type: string
            example: United Stat
  /country-codes/countries/{code}:
    get:
      tags:
        - Country Codes
      operationId: countryCodesLookup
      summary: Look up a country by code
      description: Resolve ISO2, ISO3, or numeric code to a full country record.
      responses:
        "200":
          description: Country record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  name: United States
                  iso2: US
                  iso3: USA
                  numeric: "840"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 6ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: code
          in: path
          required: true
          description: ISO2, ISO3, or numeric code
          schema:
            type: string
            example: US
  /country-codes/export:
    get:
      tags:
        - Country Codes
      operationId: countryCodesExport
      summary: Export all countries
      description: JSON by default. format=csv returns a CSV attachment.
      responses:
        "200":
          description: Exported country data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - name: United States
                    iso2: US
                    iso3: USA
                    numeric: "840"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 15ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: format
          in: query
          required: false
          description: json or csv
          schema:
            type: string
            enum:
              - json
              - csv
            example: json
  /ev-charger/stations:
    get:
      tags:
        - EV Charger
      operationId: evChargerStations
      summary: Search stations by coordinates
      description: Requires lat and lon. Optional radius_km (default 10), plug_type, level, network, and open_now.
      responses:
        "200":
          description: Matching charging stations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  count: 1
                  stations:
                    - id: "12345"
                      name: Downtown ChargePoint
                      lat: 40.7128
                      lon: -74.006
                      network: ChargePoint
                      plug_types:
                        - CCS
                        - J1772
                      level: 2
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 28ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: lat
          in: query
          required: true
          description: Latitude
          schema:
            type: number
            example: 40.7128
        - name: lon
          in: query
          required: true
          description: Longitude
          schema:
            type: number
            example: -74.006
        - name: radius_km
          in: query
          required: false
          description: Search radius in kilometers. Defaults to 10.
          schema:
            type: number
            example: 10
        - name: plug_type
          in: query
          required: false
          description: Plug type filter, e.g. CCS
          schema:
            type: string
            example: CCS
        - name: level
          in: query
          required: false
          description: Charging level 1, 2, or 3
          schema:
            type: integer
            example: 2
        - name: network
          in: query
          required: false
          description: Network name substring
          schema:
            type: string
            example: ChargePoint
        - name: open_now
          in: query
          required: false
          description: Filter to 24/7 hours when true
          schema:
            type: boolean
            example: false
  /ev-charger/stations/search:
    get:
      tags:
        - EV Charger
      operationId: evChargerStationsSearch
      summary: Search stations by address
      description: Requires address. Currently returns HTTP 501 with guidance to geocode first and use GET /ev-charger/stations.
      responses:
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        "501":
          description: Address search is not implemented. Geocode and use GET /ev-charger/stations.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: address
          in: query
          required: true
          description: Street address or place name
          schema:
            type: string
            example: New York, NY
        - name: radius_km
          in: query
          required: false
          description: Search radius in kilometers
          schema:
            type: number
            example: 10
  /ev-charger/stations/{id}:
    get:
      tags:
        - EV Charger
      operationId: evChargerStationById
      summary: Station detail by ID
      description: Full station details, or 404 with search guidance when not found.
      responses:
        "200":
          description: Station details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  id: "12345"
                  name: Downtown ChargePoint
                  address: 123 Broadway, New York, NY
                  network: ChargePoint
                  plug_types:
                    - CCS
                    - J1772
                  level: 2
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 11ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: id
          in: path
          required: true
          description: Station ID
          schema:
            type: string
            example: "12345"
  /ev-charger/networks:
    get:
      tags:
        - EV Charger
      operationId: evChargerNetworks
      summary: List charging networks
      description: Distinct charging network values for filter UIs.
      responses:
        "200":
          description: Network names
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  networks:
                    - ChargePoint
                    - Electrify America
                    - Tesla
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ev-charger/plug-types:
    get:
      tags:
        - EV Charger
      operationId: evChargerPlugTypes
      summary: List plug types
      description: Distinct plug-type values.
      responses:
        "200":
          description: Plug types
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  plug_types:
                    - CCS
                    - CHAdeMO
                    - J1772
                    - NACS
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 7ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ev-charger/levels:
    get:
      tags:
        - EV Charger
      operationId: evChargerLevels
      summary: List charging levels
      description: Charging-level descriptions (1, 2, and 3).
      responses:
        "200":
          description: Charging levels
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  levels:
                    - level: 1
                      description: AC Level 1
                    - level: 2
                      description: AC Level 2
                    - level: 3
                      description: DC Fast
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 6ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ev-charger/status/{id}:
    get:
      tags:
        - EV Charger
      operationId: evChargerStatus
      summary: Placeholder station status
      description: Placeholder occupancy payload for a single station ID. Real-time occupancy is not live yet.
      responses:
        "200":
          description: Placeholder status payload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  id: "12345"
                  occupancy: unknown
                  placeholder: true
                  note: Real-time occupancy is not live yet
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 5ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: id
          in: path
          required: true
          description: Station ID
          schema:
            type: string
            example: "12345"
  /ev-charger/status/batch:
    get:
      tags:
        - EV Charger
      operationId: evChargerStatusBatchGet
      summary: Placeholder batch status (GET)
      description: Comma-separated station_ids, up to 50 IDs. Returns placeholder occupancy until live status is wired.
      responses:
        "200":
          description: Placeholder batch status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  results:
                    - id: "12345"
                      occupancy: unknown
                      placeholder: true
                    - id: "67890"
                      occupancy: unknown
                      placeholder: true
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: station_ids
          in: query
          required: true
          description: Comma-separated station IDs
          schema:
            type: string
            example: 12345,67890
    post:
      tags:
        - EV Charger
      operationId: evChargerStatusBatchPost
      summary: Placeholder batch status (POST)
      description: "JSON body { \"station_ids\": [\"...\"] }, up to 50 IDs. Same placeholder status shape as GET."
      responses:
        "200":
          description: Placeholder batch status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  results:
                    - id: "12345"
                      occupancy: unknown
                      placeholder: true
                    - id: "67890"
                      occupancy: unknown
                      placeholder: true
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: Station IDs
        content:
          application/json:
            schema:
              type: object
              required:
                - station_ids
              properties:
                station_ids:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                  example:
                    - "12345"
                    - "67890"
            example:
              station_ids:
                - "12345"
                - "67890"
  /geocoding/forward:
    get:
      tags:
        - Geocoding
      operationId: geocodingForward
      summary: Forward geocoding
      description: Requires q. Resolves free-form place text to normalized matches with coordinates and confidence.
      responses:
        "200":
          description: Forward geocode matches
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                count: 1
                results:
                  - lat: 38.8977
                    lon: -77.0365
                    displayName: 1600 Pennsylvania Avenue NW, Washington, DC, United States
                    type: house
                    confidence:
                      score: 0.95
                      level: high
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 64ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: q
          in: query
          required: true
          description: Place text or street address
          schema:
            type: string
            example: 1600 Pennsylvania Avenue NW, Washington, DC
        - name: limit
          in: query
          required: false
          description: Max matches 1-10, default 5
          schema:
            type: integer
            example: 5
        - name: language
          in: query
          required: false
          description: Preferred language tag
          schema:
            type: string
            example: en
        - name: countryCodes
          in: query
          required: false
          description: Comma-separated ISO2 country filter
          schema:
            type: string
            example: us
  /geocoding/reverse:
    get:
      tags:
        - Geocoding
      operationId: geocodingReverse
      summary: Reverse geocoding
      description: Requires lat and lon. Returns a structured address for the coordinate.
      responses:
        "200":
          description: Reverse geocode result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                address:
                  displayName: 1600 Pennsylvania Avenue NW, Washington, DC 20500, United States
                  road: Pennsylvania Avenue NW
                  city: Washington
                  state: District of Columbia
                  postcode: "20500"
                  country: United States
                  countryCode: us
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 48ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: lat
          in: query
          required: true
          description: Latitude
          schema:
            type: number
            example: 38.8977
        - name: lon
          in: query
          required: true
          description: Longitude
          schema:
            type: number
            example: -77.0365
        - name: language
          in: query
          required: false
          description: Preferred language tag
          schema:
            type: string
            example: en
        - name: zoom
          in: query
          required: false
          description: Detail zoom 0-18
          schema:
            type: integer
            example: 18
  /geocoding/batch:
    post:
      tags:
        - Geocoding
      operationId: geocodingBatch
      summary: Batch forward and reverse geocoding
      description: Up to 25 mixed queries. Each item is either { q } (forward) or { lat, lon } (reverse).
      responses:
        "200":
          description: Per-item geocode results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                count: 2
                successCount: 2
                failureCount: 0
                results:
                  - result:
                      success: true
                      lat: 48.8584
                      lon: 2.2945
                      displayName: Tour Eiffel, Paris, France
                  - result:
                      success: true
                      address:
                        city: New York
                        country: United States
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 112ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: Batch queries
        content:
          application/json:
            schema:
              type: object
              required:
                - queries
              properties:
                queries:
                  type: array
                  minItems: 1
                  maxItems: 25
                  items:
                    type: object
            example:
              queries:
                - q: Eiffel Tower
                - lat: 40.7128
                  lon: -74.006
  /helicopter/lookup:
    get:
      tags:
        - Helicopter
      operationId: helicopterLookup
      summary: Look up rotorcraft by tail number
      description: Requires tail. Resolves FAA N-number registration for helicopters.
      responses:
        "200":
          description: Helicopter registration details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  tail: N123AB
                  manufacturer: ROBINSON HELICOPTER
                  model: R44
                  serial: "12345"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 19ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: tail
          in: query
          required: true
          description: FAA N-number / tail
          schema:
            type: string
            example: N123AB
  /helicopter/icao/{hex}:
    get:
      tags:
        - Helicopter
      operationId: helicopterIcaoLookup
      summary: ICAO hex lookup
      description: Validates a 6-character ICAO hex. Data resolution is on the roadmap (may return a reason today).
      responses:
        "200":
          description: ICAO lookup result or roadmap reason
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  hex: A1B2C3
                  reason: ICAO hex data resolution is on the roadmap
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 6ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: hex
          in: path
          required: true
          description: ICAO hex
          schema:
            type: string
            example: A1B2C3
  /helicopter/serial/{sn}:
    get:
      tags:
        - Helicopter
      operationId: helicopterSerialLookup
      summary: Look up rotorcraft by serial number
      description: FAA serial-number search.
      responses:
        "200":
          description: Matching helicopter records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  serial: "12345"
                  tail: N123AB
                  manufacturer: ROBINSON HELICOPTER
                  model: R44
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 14ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: sn
          in: path
          required: true
          description: Serial number
          schema:
            type: string
            example: "12345"
  /helicopter/manufacturers:
    get:
      tags:
        - Helicopter
      operationId: helicopterManufacturers
      summary: List helicopter manufacturers
      description: Distinct manufacturer names from the FAA rotorcraft registry.
      responses:
        "200":
          description: Manufacturer names
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  manufacturers:
                    - ROBINSON HELICOPTER
                    - BELL
                    - AIRBUS HELICOPTERS
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /helicopter/models/{manufacturer}:
    get:
      tags:
        - Helicopter
      operationId: helicopterModels
      summary: List models for a manufacturer
      description: Models registered under the given manufacturer name.
      responses:
        "200":
          description: Model names
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  manufacturer: ROBINSON HELICOPTER
                  models:
                    - R22
                    - R44
                    - R66
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 9ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: manufacturer
          in: path
          required: true
          description: Manufacturer name
          schema:
            type: string
            example: ROBINSON HELICOPTER
  /helicopter/batch:
    post:
      tags:
        - Helicopter
      operationId: helicopterBatch
      summary: Batch helicopter lookups
      description: "JSON array or { items: [...] } of tail numbers."
      responses:
        "200":
          description: Batch lookup results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  results:
                    - tail: N123AB
                      manufacturer: ROBINSON HELICOPTER
                      model: R44
                    - tail: N456CD
                      manufacturer: BELL
                      model: 206B
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 37ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: Batch items
        content:
          application/json:
            schema:
              type: object
              required: []
              properties:
                items:
                  type: array
                  items:
                    type: string
                    example: N123AB
            example:
              items:
                - N123AB
                - N456CD
  /pdf-generation/from-url:
    post:
      tags:
        - PDF Generation
      operationId: pdfGenerationFromUrl
      summary: Render a PDF from a public URL
      description: >-
        SSRF-guarded on the entry URL and redirects. responseType=binary (default) returns application/pdf; base64
        returns JSON.
      responses:
        "200":
          description: PDF bytes or base64 JSON payload
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                pdfBase64: JVBERi0xLjQK
                pdfMetadata:
                  pages: 1
                  format: A4
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 420ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: URL render request
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  example: https://example.com
                format:
                  type: string
                  enum:
                    - A4
                    - Letter
                    - Legal
                    - Tabloid
                  example: A4
                responseType:
                  type: string
                  enum:
                    - binary
                    - base64
                  example: base64
            example:
              url: https://example.com
              format: A4
              responseType: base64
  /pdf-generation/from-html:
    post:
      tags:
        - PDF Generation
      operationId: pdfGenerationFromHtml
      summary: Render a PDF from HTML
      description: Sanitized HTML string, up to 512,000 characters.
      responses:
        "200":
          description: PDF bytes or base64 JSON payload
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                pdfBase64: JVBERi0xLjQK
                pdfMetadata:
                  pages: 1
                  format: A4
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 310ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: HTML render request
        content:
          application/json:
            schema:
              type: object
              required:
                - html
              properties:
                html:
                  type: string
                  example: <html><body><h1>Invoice</h1></body></html>
                format:
                  type: string
                  enum:
                    - A4
                    - Letter
                    - Legal
                    - Tabloid
                  example: A4
                responseType:
                  type: string
                  enum:
                    - binary
                    - base64
                  example: base64
            example:
              html: <html><body><h1>Invoice</h1></body></html>
              format: A4
              responseType: base64
  /public-holidays:
    get:
      tags:
        - Public Holidays
      operationId: publicHolidaysQuery
      summary: Query public holidays
      description: >-
        Holiday rows for one or more countries. Filter by year, month, or start_date/end_date. JSON by default;
        format=csv returns CSV. Defaults to the current year for country=US when no date filter is set.
      responses:
        "200":
          description: Holiday rows
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - date: "2026-12-25"
                    name: Christmas Day
                    country: US
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 13ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: country
          in: query
          required: false
          description: Comma-separated ISO2, ISO3, or country names
          schema:
            type: string
            example: US,CA
        - name: year
          in: query
          required: false
          description: Year filter
          schema:
            type: integer
            example: 2026
        - name: month
          in: query
          required: false
          description: Month 1-12
          schema:
            type: integer
            example: 12
        - name: start_date
          in: query
          required: false
          description: Range start YYYY-MM-DD
          schema:
            type: string
            example: "2026-01-01"
        - name: end_date
          in: query
          required: false
          description: Range end YYYY-MM-DD
          schema:
            type: string
            example: "2026-12-31"
        - name: format
          in: query
          required: false
          description: json or csv
          schema:
            type: string
            enum:
              - json
              - csv
            example: json
  /public-holidays/countries:
    get:
      tags:
        - Public Holidays
      operationId: publicHolidaysCountries
      summary: List supported countries
      description: Country metadata with ISO2, name, ISO3, and numeric code.
      responses:
        "200":
          description: Supported countries
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - iso2: US
                    name: United States
                    iso3: USA
                    numeric: "840"
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /qr-code/generate:
    post:
      tags:
        - QR Code
      operationId: qrCodeGenerate
      summary: Generate a QR code
      description: Encode text into PNG or SVG. responseType json (default) or base64 returns JSON; binary returns the image bytes.
      responses:
        "200":
          description: QR image bytes or JSON payload
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/svg+xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                format: png
                contentType: image/png
                data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwADhQGAWjR9awAAAABJRU5ErkJggg==
                byteLength: 70
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 24ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: QR generate request
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  example: https://datpaq.com
                format:
                  type: string
                  enum:
                    - png
                    - svg
                  example: png
                size:
                  type: integer
                  example: 256
                responseType:
                  type: string
                  enum:
                    - binary
                    - base64
                    - json
                  example: json
            example:
              text: https://datpaq.com
              format: png
              size: 256
              responseType: json
  /qr-code/decode:
    post:
      tags:
        - QR Code
      operationId: qrCodeDecode
      summary: Decode a QR code image
      description: Requires imageBase64. Optionally return all codes up to maxCodes.
      responses:
        "200":
          description: Decoded QR payload
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                text: https://datpaq.com
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 18ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: QR decode request
        content:
          application/json:
            schema:
              type: object
              required:
                - imageBase64
              properties:
                imageBase64:
                  type: string
                  description: Base64-encoded image
                all:
                  type: boolean
                  example: false
                maxCodes:
                  type: integer
                  example: 5
            example:
              imageBase64: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwADhQGAWjR9awAAAABJRU5ErkJggg==
              all: false
              maxCodes: 5
  /us-states:
    get:
      tags:
        - US States
      operationId: usStatesList
      summary: List or search US states
      description: No params returns all 50 states. q searches name/abbreviation. abbr=CA,TX batches up to 56 abbreviations.
      responses:
        "200":
          description: State records
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  - name: California
                    abbreviation: CA
                    fips: "06"
                    capital: Sacramento
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 7ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: q
          in: query
          required: false
          description: Search name or abbreviation
          schema:
            type: string
            example: cali
        - name: abbr
          in: query
          required: false
          description: Comma-separated abbreviations
          schema:
            type: string
            example: CA,TX,NY
  /us-states/{abbr}:
    get:
      tags:
        - US States
      operationId: usStatesByAbbr
      summary: Look up a state by abbreviation
      description: Two-letter code, e.g. CA.
      responses:
        "200":
          description: State record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  name: California
                  abbreviation: CA
                  fips: "06"
                  capital: Sacramento
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 5ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: abbr
          in: path
          required: true
          description: Two-letter abbreviation
          schema:
            type: string
            example: CA
  /us-states/fips/{fipscode}:
    get:
      tags:
        - US States
      operationId: usStatesByFips
      summary: Look up a state by FIPS code
      description: Codes are padded to two digits, so 6 resolves to 06.
      responses:
        "200":
          description: State record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  name: California
                  abbreviation: CA
                  fips: "06"
                  capital: Sacramento
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 5ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: fipscode
          in: path
          required: true
          description: FIPS code
          schema:
            type: string
            example: "06"
  /vin-lookup/decode:
    post:
      tags:
        - VIN Lookup
      operationId: vinLookupDecode
      summary: Decode one or more VINs
      description: JSON body vin as a string or an array of up to 50 VINs. Uses NHTSA VPIC.
      responses:
        "200":
          description: Decoded vehicle fields
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  vin: 1HGCM82633A004352
                  make: HONDA
                  model: Accord
                  modelYear: "2003"
                  bodyClass: Sedan/Saloon
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 86ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      requestBody:
        required: true
        description: VIN decode request
        content:
          application/json:
            schema:
              type: object
              required:
                - vin
              properties:
                vin:
                  description: Single VIN or array of VINs
                  oneOf:
                    - type: string
                      example: 1HGCM82633A004352
                    - type: array
                      maxItems: 50
                      items:
                        type: string
            example:
              vin: 1HGCM82633A004352
  /vin-lookup/decode/{vin}:
    get:
      tags:
        - VIN Lookup
      operationId: vinLookupDecodeGet
      summary: Decode a VIN via path
      description: Convenience GET that 307-redirects to /vin-lookup/sample/{vin}.
      responses:
        "307":
          description: Redirects to GET /vin-lookup/sample/{vin}
          headers:
            Location:
              description: Canonical sample-decode URL
              schema:
                type: string
                example: /api/v1/vin-lookup/sample/1HGCM82633A004352
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: vin
          in: path
          required: true
          description: 17-character VIN
          schema:
            type: string
            example: 1HGCM82633A004352
  /vin-lookup/sample/{vin}:
    get:
      tags:
        - VIN Lookup
      operationId: vinLookupSample
      summary: Sample VIN decode
      description: Single-VIN decode used by the GET /decode/{vin} alias.
      responses:
        "200":
          description: Decoded vehicle fields
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  vin: 1HGCM82633A004352
                  make: HONDA
                  model: Accord
                  modelYear: "2003"
                  bodyClass: Sedan/Saloon
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 82ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: vin
          in: path
          required: true
          description: 17-character VIN
          schema:
            type: string
            example: 1HGCM82633A004352
  /vin-lookup/makes:
    get:
      tags:
        - VIN Lookup
      operationId: vinLookupMakes
      summary: List vehicle makes
      description: Reference list of vehicle makes from NHTSA.
      responses:
        "200":
          description: Vehicle makes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  makes:
                    - HONDA
                    - FORD
                    - TOYOTA
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 20ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vin-lookup/suggest/{prefix}:
    get:
      tags:
        - VIN Lookup
      operationId: vinLookupSuggest
      summary: VIN prefix suggestions
      description: Manufacturer suggestions for a VIN prefix / WMI.
      responses:
        "200":
          description: Prefix suggestions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  prefix: 1HG
                  suggestions:
                    - make: HONDA
                      wmi: 1HG
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 12ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: prefix
          in: path
          required: true
          description: VIN prefix
          schema:
            type: string
            example: 1HG
  /weather/current:
    get:
      tags:
        - Weather
      operationId: weatherCurrent
      summary: Current weather conditions
      description: Requires lat and lon. Returns normalized current conditions (humidity, wind, pressure, UV, precipitation).
      responses:
        "200":
          description: Current conditions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                location:
                  lat: 40.7128
                  lon: -74.006
                  name: New York
                  country: US
                current:
                  temperature: 72
                  temperatureUnit: fahrenheit
                  condition: Partly Cloudy
                  humidity: 58
                  windSpeed: 8 mph
                units: fahrenheit
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 95ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: lat
          in: query
          required: true
          description: Latitude
          schema:
            type: number
            example: 40.7128
        - name: lon
          in: query
          required: true
          description: Longitude
          schema:
            type: number
            example: -74.006
        - name: units
          in: query
          required: false
          description: auto, celsius, or fahrenheit
          schema:
            type: string
            enum:
              - auto
              - celsius
              - fahrenheit
            example: auto
  /weather/forecast:
    get:
      tags:
        - Weather
      operationId: weatherForecast
      summary: Current conditions plus forecast
      description: Requires lat and lon. forecastDays defaults to 7 (max 14).
      responses:
        "200":
          description: Current conditions and forecast
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                location:
                  lat: 40.7128
                  lon: -74.006
                  name: New York
                  country: US
                current:
                  temperature: 72
                  temperatureUnit: fahrenheit
                  condition: Partly Cloudy
                forecast:
                  - date: "2026-08-20"
                    high: 78
                    low: 64
                    condition: Partly Cloudy
                units: fahrenheit
                metadata:
                  correlationId: abc123-def456
                  timestamp: "2026-08-20T12:00:00.000Z"
                  processingTime: 110ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: lat
          in: query
          required: true
          description: Latitude
          schema:
            type: number
            example: 40.7128
        - name: lon
          in: query
          required: true
          description: Longitude
          schema:
            type: number
            example: -74.006
        - name: units
          in: query
          required: false
          description: auto, celsius, or fahrenheit
          schema:
            type: string
            enum:
              - auto
              - celsius
              - fahrenheit
            example: auto
        - name: forecastDays
          in: query
          required: false
          description: Forecast length 1-14
          schema:
            type: integer
            example: 7
  /web-search/search:
    get:
      tags:
        - Web Search
      operationId: webSearchSearch
      summary: Search the web for a single query
      description: Returns instant answers, related topics, and results for one query.
      responses:
        "200":
          description: Search results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                query: JavaScript
                abstract: JavaScript
                abstractText: JavaScript is a high-level, interpreted programming language...
                abstractUrl: https://en.wikipedia.org/wiki/JavaScript
                abstractSource: Wikipedia
                relatedTopics:
                  - text: ECMAScript
                    url: https://duckduckgo.com/ECMAScript
                results: []
                fromCache: false
                provider: duckduckgo
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
      parameters:
        - name: q
          in: query
          required: true
          description: Search query (1-256 characters)
          schema:
            type: string
            example: datpaq api
        - name: limit
          in: query
          required: false
          description: Max related topics and results per section (1-10, default 10)
          schema:
            type: integer
            example: 5
    post:
      tags:
        - Web Search
      operationId: webSearchBatch
      summary: Batch web search for up to 10 queries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - queries
              properties:
                queries:
                  type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                  example:
                    - weather nyc
                    - geocoding api
                limit:
                  type: integer
                  example: 5
            example:
              queries:
                - JavaScript
                - TypeScript
              limit: 5
      responses:
        "200":
          description: Batch search results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - success: true
                    query: JavaScript
                    abstract: JavaScript
                    relatedTopics: []
                    results: []
                summary:
                  total: 1
                  succeeded: 1
                  failed: 0
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /interest-rate/current:
    get:
      tags:
        - Interest Rate
      operationId: interestRateCurrent
      summary: Get current benchmark rates by category
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  central_bank:
                    fed_funds_rate:
                      label: Federal Funds Rate
                      value: 4.33
                      trend: flat
                      change_1m: 0
                      value_1m_ago: 4.33
                      value_1y_ago: 5.33
                      as_of: "2026-07-17"
                      series_id: DFF
                  treasury:
                    t_10yr:
                      label: 10-Year Treasury
                      value: 4.32
                      trend: rising
                      change_1m: 0.04
                      value_1m_ago: 4.28
                      value_1y_ago: 4.4
                      as_of: "2026-07-17"
                      series_id: DGS10
                data_source: snapshot
                snapshot_date: "2026-07-17"
                correlationId: ...
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /interest-rate/yield-curve:
    get:
      tags:
        - Interest Rate
      operationId: interestRateYieldCurve
      summary: Get the ordered Treasury yield curve
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /libor:
    get:
      tags:
        - LIBOR
      operationId: liborLatest
      summary: Get the latest benchmark rate
      parameters:
        - name: benchmark
          in: query
          required: false
          description: "Benchmark: sofr (default) or libor"
          schema:
            type: string
            example: sofr
        - name: tenor
          in: query
          required: false
          description: "Tenor: 1m, 3m, 6m, or 12m"
          schema:
            type: string
            example: 3m
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y, max, or available"
          schema:
            type: string
            example: available
        - name: source
          in: query
          required: false
          description: "Data source: auto, fred, or snapshot"
          schema:
            type: string
            example: auto
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                source: snapshot
                benchmark: sofr
                tenor: 3m
                latest:
                  date: "2026-07-01"
                  value: 5.15
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /libor/history:
    get:
      tags:
        - LIBOR
      operationId: liborHistory
      summary: Get benchmark rate history
      parameters:
        - name: benchmark
          in: query
          required: false
          description: "Benchmark: sofr (default) or libor"
          schema:
            type: string
            example: sofr
        - name: tenor
          in: query
          required: false
          description: "Tenor: 1m, 3m, 6m, or 12m"
          schema:
            type: string
            example: 3m
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y, max, or available"
          schema:
            type: string
            example: available
        - name: source
          in: query
          required: false
          description: "Data source: auto, fred, or snapshot"
          schema:
            type: string
            example: auto
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-02-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-07-01"
        - name: sort
          in: query
          required: false
          description: "Sort order: asc (default) or desc"
          schema:
            type: string
            example: desc
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /libor/spread:
    get:
      tags:
        - LIBOR
      operationId: liborSpread
      summary: Get the spread between two tenors
      parameters:
        - name: benchmark
          in: query
          required: false
          description: "Benchmark: sofr (default) or libor"
          schema:
            type: string
            example: sofr
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y, max, or available"
          schema:
            type: string
            example: available
        - name: source
          in: query
          required: false
          description: "Data source: auto, fred, or snapshot"
          schema:
            type: string
            example: auto
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-02-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-07-01"
        - name: sort
          in: query
          required: false
          description: "Sort order: asc (default) or desc"
          schema:
            type: string
            example: desc
        - name: shortTenor
          in: query
          required: false
          description: "Short-leg tenor: 1m, 3m, 6m, or 12m"
          schema:
            type: string
            example: 3m
        - name: longTenor
          in: query
          required: false
          description: "Long-leg tenor: 1m, 3m, 6m, or 12m"
          schema:
            type: string
            example: 12m
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /libor/catalog:
    get:
      tags:
        - LIBOR
      operationId: liborCatalog
      summary: List supported benchmarks, tenors, and coverage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /mortgage-calculator/payment:
    get:
      tags:
        - Mortgage Calculator
      operationId: mortgageCalculatorPayment
      summary: Calculate monthly payment, total interest, and optional amortization
      parameters:
        - name: interest_rate
          in: query
          required: true
          description: Annual percentage rate
          schema:
            type: number
            example: 6.5
        - name: loan_amount
          in: query
          required: false
          description: Loan principal (or pass --home-value and --downpayment)
          schema:
            type: number
            example: 350000
        - name: home_value
          in: query
          required: false
          description: Home value, used with --downpayment
          schema:
            type: number
            example: 400000
        - name: downpayment
          in: query
          required: false
          description: Down payment, less than --home-value
          schema:
            type: number
            example: 50000
        - name: duration_years
          in: query
          required: false
          description: Loan term in years (default 30)
          schema:
            type: number
            example: 30
        - name: monthly_extra_payment
          in: query
          required: false
          description: Additional monthly principal payment
          schema:
            type: number
            example: 200
        - name: monthly_hoa
          in: query
          required: false
          description: Monthly HOA amount
          schema:
            type: number
            example: 150
        - name: annual_property_tax
          in: query
          required: false
          description: Annual property tax
          schema:
            type: number
            example: 4800
        - name: annual_home_insurance
          in: query
          required: false
          description: Annual home insurance
          schema:
            type: number
            example: 1200
        - name: includeSchedule
          in: query
          required: false
          description: Include an amortization schedule
          schema:
            type: boolean
            example: true
        - name: start_date
          in: query
          required: false
          description: Schedule start date (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-01-01"
        - name: annual_appreciation_rate
          in: query
          required: false
          description: Annual home appreciation percentage (-100 to 100)
          schema:
            type: number
            example: 3
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  monthly_loan_payment: 2528.27
                  monthly_escrow_estimate: 0
                  total_monthly_payment: 2528.27
                  total_interest_paid: 510177.95
                  total_loan_cost: 910177.95
                  early_payoff_months_saved: 0
                  interest_savings_with_extra_payment: 0
                correlationId: 1784510786787-bt029igzs
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /mortgage-calculator/refinance:
    get:
      tags:
        - Mortgage Calculator
      operationId: mortgageCalculatorRefinance
      summary: Simulate a refinance and its break-even point
      parameters:
        - name: current_loan_amount
          in: query
          required: true
          description: Current loan balance
          schema:
            type: number
            example: 280000
        - name: current_interest_rate
          in: query
          required: true
          description: Current annual rate
          schema:
            type: number
            example: 7
        - name: current_remaining_years
          in: query
          required: true
          description: Current remaining term in years
          schema:
            type: number
            example: 25
        - name: new_interest_rate
          in: query
          required: true
          description: Proposed annual rate
          schema:
            type: number
            example: 5.75
        - name: new_duration_years
          in: query
          required: true
          description: Proposed term in years
          schema:
            type: number
            example: 25
        - name: refinance_cost
          in: query
          required: false
          description: Refinance closing cost
          schema:
            type: number
            example: 5000
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /mortgage-calculator/current-rates:
    get:
      tags:
        - Mortgage Calculator
      operationId: mortgageCalculatorCurrentRates
      summary: Get weekly average mortgage rates from FRED
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /economic-indicators/indicators:
    get:
      tags:
        - Economic Indicators
      operationId: economicIndicatorsIndicators
      summary: List available indicators
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /economic-indicators/series/{id}:
    get:
      tags:
        - Economic Indicators
      operationId: economicIndicatorsSeries
      summary: Get history for an indicator
      parameters:
        - name: id
          in: path
          required: true
          description: Catalog indicator ID
          schema:
            type: string
            example: us_gdp_growth
        - name: limit
          in: query
          required: false
          description: Observations (1-60, default 12)
          schema:
            type: integer
            example: 24
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                id: us_gdp_growth
                name: US GDP Growth
                country: US
                source: fred
                unit: percent
                fromCache: false
                observations:
                  - date: "2025-01-01"
                    value: 2.4
                updatedAt: "2026-06-10T12:00:00.000Z"
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /economic-indicators/series/{id}/latest:
    get:
      tags:
        - Economic Indicators
      operationId: economicIndicatorsLatest
      summary: Get the latest value for an indicator
      parameters:
        - name: id
          in: path
          required: true
          description: Catalog indicator ID
          schema:
            type: string
            example: us_gdp_growth
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /economic-indicators/interest-rates:
    get:
      tags:
        - Economic Indicators
      operationId: economicIndicatorsInterestRates
      summary: Get key interest rates
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /gdp:
    get:
      tags:
        - GDP
      operationId: gdpLatest
      summary: Get the latest GDP observation
      parameters:
        - name: dataset
          in: query
          required: false
          description: "Dataset: nominal (default), real, or deflator"
          schema:
            type: string
            example: nominal
        - name: source
          in: query
          required: false
          description: "Source mode: auto (default), snapshot, or live"
          schema:
            type: string
            example: snapshot
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                source: snapshot
                dataset: nominal
                latest:
                  date: "2026-06-01"
                  value: 30834.1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /gdp/history:
    get:
      tags:
        - GDP
      operationId: gdpHistory
      summary: Get GDP history
      parameters:
        - name: dataset
          in: query
          required: false
          description: "Dataset: nominal (default), real, or deflator"
          schema:
            type: string
            example: nominal
        - name: source
          in: query
          required: false
          description: "Source mode: auto (default), snapshot, or live"
          schema:
            type: string
            example: snapshot
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y (default), or 10y"
          schema:
            type: string
            example: 5y
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2023-01-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-06-01"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /gdp/growth:
    get:
      tags:
        - GDP
      operationId: gdpGrowth
      summary: Get GDP growth rates
      parameters:
        - name: dataset
          in: query
          required: false
          description: "Dataset: nominal (default), real, or deflator"
          schema:
            type: string
            example: nominal
        - name: source
          in: query
          required: false
          description: "Source mode: auto (default), snapshot, or live"
          schema:
            type: string
            example: snapshot
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2023-01-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-06-01"
        - name: points
          in: query
          required: false
          description: Trailing observations (2-80, default 12)
          schema:
            type: integer
            example: 12
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /gdp/compare:
    get:
      tags:
        - GDP
      operationId: gdpCompare
      summary: Compare GDP datasets
      parameters:
        - name: source
          in: query
          required: false
          description: "Source mode: auto (default), snapshot, or live"
          schema:
            type: string
            example: snapshot
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y (default), or 10y"
          schema:
            type: string
            example: 5y
        - name: datasets
          in: query
          required: false
          description: Comma-separated datasets (default all)
          schema:
            type: string
            example: nominal,real
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /gdp/catalog:
    get:
      tags:
        - GDP
      operationId: gdpCatalog
      summary: List datasets, sources, and periods
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap:
    get:
      tags:
        - Market Cap
      operationId: marketCapLookup
      summary: Get market cap for a symbol
      parameters:
        - name: symbol
          in: query
          required: true
          description: Ticker symbol
          schema:
            type: string
            example: AAPL
        - name: mode
          in: query
          required: false
          description: "Data mode: snapshot (default) or live"
          schema:
            type: string
            example: snapshot
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                mode: snapshot
                symbol: AAPL
                marketCap: 3530000000000
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap/history:
    get:
      tags:
        - Market Cap
      operationId: marketCapHistory
      summary: Get market cap history for a symbol
      parameters:
        - name: symbol
          in: query
          required: true
          description: Ticker symbol
          schema:
            type: string
            example: AAPL
        - name: mode
          in: query
          required: false
          description: "Data mode: snapshot (default) or live"
          schema:
            type: string
            example: snapshot
        - name: period
          in: query
          required: false
          description: "Period: 1m, 3m, 6m, 1y, 3y, or 5y"
          schema:
            type: string
            example: 1y
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2025-01-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-07-01"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap/trend:
    get:
      tags:
        - Market Cap
      operationId: marketCapTrend
      summary: Get market cap trend statistics for a symbol
      parameters:
        - name: symbol
          in: query
          required: true
          description: Ticker symbol
          schema:
            type: string
            example: AAPL
        - name: mode
          in: query
          required: false
          description: "Data mode: snapshot (default) or live"
          schema:
            type: string
            example: snapshot
        - name: period
          in: query
          required: false
          description: "Period: 1m, 3m, 6m, 1y, 3y, or 5y"
          schema:
            type: string
            example: 1y
        - name: startDate
          in: query
          required: false
          description: Inclusive lower bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2025-01-01"
        - name: endDate
          in: query
          required: false
          description: Inclusive upper bound (YYYY-MM-DD)
          schema:
            type: string
            example: "2026-07-01"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap/top:
    get:
      tags:
        - Market Cap
      operationId: marketCapTop
      summary: List the largest companies by market cap
      parameters:
        - name: limit
          in: query
          required: false
          description: Number of companies (1-50, default 5)
          schema:
            type: integer
            example: 5
        - name: sector
          in: query
          required: false
          description: Exact sector filter
          schema:
            type: string
            example: Technology
        - name: sort
          in: query
          required: false
          description: "Sort order: desc (default) or asc"
          schema:
            type: string
            example: desc
        - name: minMarketCap
          in: query
          required: false
          description: Inclusive lower market cap bound
          schema:
            type: number
            example: 100000000000
        - name: maxMarketCap
          in: query
          required: false
          description: Inclusive upper market cap bound
          schema:
            type: number
            example: 3000000000000
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap/compare:
    get:
      tags:
        - Market Cap
      operationId: marketCapCompare
      summary: Compare market caps across symbols
      parameters:
        - name: symbols
          in: query
          required: true
          description: Comma-separated symbols (at least two)
          schema:
            type: string
            example: AAPL,MSFT,NVDA
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /market-cap/catalog:
    get:
      tags:
        - Market Cap
      operationId: marketCapCatalog
      summary: List supported symbols, sectors, and periods
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sec-filings/catalog:
    get:
      tags:
        - SEC Filings
      operationId: secFilingsCatalog
      summary: List supported forms, taxonomies, and limits
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sec-filings/company:
    get:
      tags:
        - SEC Filings
      operationId: secFilingsCompany
      summary: Get a company profile by CIK or ticker
      parameters:
        - name: cik
          in: query
          required: false
          description: SEC CIK identifier (or pass --ticker)
          schema:
            type: string
            example: "320193"
        - name: ticker
          in: query
          required: false
          description: Stock ticker (or pass --cik)
          schema:
            type: string
            example: AAPL
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                source: sec-edgar
                company:
                  cik: "0000320193"
                  ticker: AAPL
                count: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sec-filings/filings:
    get:
      tags:
        - SEC Filings
      operationId: secFilingsFilings
      summary: List recent filings for a company
      parameters:
        - name: form
          in: query
          required: false
          description: Single form filter
          schema:
            type: string
            example: 10-K
        - name: forms
          in: query
          required: false
          description: Comma-separated form filters
          schema:
            type: string
            example: 10-K,10-Q
        - name: cik
          in: query
          required: false
          description: SEC CIK identifier (or pass --ticker)
          schema:
            type: string
            example: "320193"
        - name: ticker
          in: query
          required: false
          description: Stock ticker (or pass --cik)
          schema:
            type: string
            example: AAPL
        - name: sort
          in: query
          required: false
          description: "Filing date order: desc (default) or asc"
          schema:
            type: string
            example: desc
        - name: limit
          in: query
          required: false
          description: Max filings (1-100, default 20)
          schema:
            type: integer
            example: 20
        - name: offset
          in: query
          required: false
          description: Pagination offset (0-2000)
          schema:
            type: integer
            example: 0
        - name: fromDate
          in: query
          required: false
          description: Inclusive lower filing date (YYYY-MM-DD)
          schema:
            type: string
            example: "2024-01-01"
        - name: toDate
          in: query
          required: false
          description: Inclusive upper filing date (YYYY-MM-DD)
          schema:
            type: string
            example: "2024-12-31"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sec-filings/forms/{formType}:
    get:
      tags:
        - SEC Filings
      operationId: secFilingsForms
      summary: List a company's filings of one form type
      parameters:
        - name: formType
          in: path
          required: true
          description: Form type
          schema:
            type: string
            example: 10-K
        - name: cik
          in: query
          required: false
          description: SEC CIK identifier (or pass --ticker)
          schema:
            type: string
            example: "320193"
        - name: ticker
          in: query
          required: false
          description: Stock ticker (or pass --cik)
          schema:
            type: string
            example: AAPL
        - name: sort
          in: query
          required: false
          description: "Filing date order: desc (default) or asc"
          schema:
            type: string
            example: desc
        - name: limit
          in: query
          required: false
          description: Max filings (1-100, default 20)
          schema:
            type: integer
            example: 20
        - name: offset
          in: query
          required: false
          description: Pagination offset (0-2000)
          schema:
            type: integer
            example: 0
        - name: fromDate
          in: query
          required: false
          description: Inclusive lower filing date (YYYY-MM-DD)
          schema:
            type: string
            example: "2024-01-01"
        - name: toDate
          in: query
          required: false
          description: Inclusive upper filing date (YYYY-MM-DD)
          schema:
            type: string
            example: "2024-12-31"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /sec-filings/facts:
    get:
      tags:
        - SEC Filings
      operationId: secFilingsFacts
      summary: Get XBRL concept facts for a company
      parameters:
        - name: cik
          in: query
          required: false
          description: SEC CIK identifier (or pass --ticker)
          schema:
            type: string
            example: "320193"
        - name: ticker
          in: query
          required: false
          description: Stock ticker (or pass --cik)
          schema:
            type: string
            example: AAPL
        - name: tag
          in: query
          required: true
          description: XBRL concept tag
          schema:
            type: string
            example: Assets
        - name: taxonomy
          in: query
          required: false
          description: XBRL taxonomy (default us-gaap)
          schema:
            type: string
            example: us-gaap
        - name: units
          in: query
          required: false
          description: Preferred unit key
          schema:
            type: string
            example: USD
        - name: limit
          in: query
          required: false
          description: Max facts (1-40, default 12)
          schema:
            type: integer
            example: 12
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment:
    get:
      tags:
        - Unemployment
      operationId: unemploymentNational
      summary: Get the national unemployment rate
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, 5y, or 10y (default latest)"
          schema:
            type: string
            example: 1y
        - name: adjusted
          in: query
          required: false
          description: Seasonally adjusted series (default true)
          schema:
            type: boolean
            example: false
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                name: National Unemployment Rate (Seasonally Adjusted)
                unit: "%"
                adjusted: true
                period: latest
                latest:
                  date: "2026-06-01"
                  value: 4.1
                changes: null
                meta:
                  source: FRED / BLS CPS
                  seriesId: UNRATE
                  fromCache: false
                  correlationId: 1784690347028-abc123
                  timestamp: "2026-07-21T12:00:00.000Z"
                  processingTime: 142ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/measures:
    get:
      tags:
        - Unemployment
      operationId: unemploymentMeasures
      summary: Get U-1 through U-6 measures
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, or 5y (default latest)"
          schema:
            type: string
            example: 1y
        - name: measure
          in: query
          required: false
          description: "Measure: u1-u6 or all (default)"
          schema:
            type: string
            example: u6
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/labor-force:
    get:
      tags:
        - Unemployment
      operationId: unemploymentLaborForce
      summary: Get participation and employment-population ratios
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, or 5y (default latest)"
          schema:
            type: string
            example: 1y
        - name: metric
          in: query
          required: false
          description: "Metric: participation, employment-ratio, or both (default)"
          schema:
            type: string
            example: participation
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/claims:
    get:
      tags:
        - Unemployment
      operationId: unemploymentClaims
      summary: Get initial and continued jobless claims
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, or 2y (default latest)"
          schema:
            type: string
            example: 1y
        - name: type
          in: query
          required: false
          description: "Claims type: initial, continued, or both (default)"
          schema:
            type: string
            example: initial
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/long-term:
    get:
      tags:
        - Unemployment
      operationId: unemploymentLongTerm
      summary: Get long-term unemployment
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest, 1y, or 5y (default latest)"
          schema:
            type: string
            example: 1y
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/demographic:
    get:
      tags:
        - Unemployment
      operationId: unemploymentDemographic
      summary: Get unemployment by demographic group
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest or 1y (default latest)"
          schema:
            type: string
            example: 1y
        - name: group
          in: query
          required: true
          description: "Group: age, gender, race, or education"
          schema:
            type: string
            example: race
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/state:
    get:
      tags:
        - Unemployment
      operationId: unemploymentState
      summary: Get unemployment for one state or DC
      parameters:
        - name: period
          in: query
          required: false
          description: "Window: latest or 1y (default latest)"
          schema:
            type: string
            example: 1y
        - name: state
          in: query
          required: true
          description: Two-letter US state or DC code
          schema:
            type: string
            example: CA
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/states:
    get:
      tags:
        - Unemployment
      operationId: unemploymentStates
      summary: Get latest unemployment for all states and DC
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                count: 51
                unit: "%"
                adjusted: true
                states:
                  - state: CA
                    name: California
                    rate: 4.7
                    date: "2026-05-01"
                    available: true
                  - state: TX
                    name: Texas
                    rate: 3.9
                    date: "2026-05-01"
                    available: true
                meta:
                  source: FRED / BLS LAUS
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /unemployment/series:
    get:
      tags:
        - Unemployment
      operationId: unemploymentSeries
      summary: List the unemployment series catalog
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /iban/{iban}:
    get:
      tags:
        - IBAN
      operationId: ibanLookup
      summary: Validate one IBAN from the URL path
      parameters:
        - name: iban
          in: path
          required: true
          description: IBAN to validate
          schema:
            type: string
            example: DE89370400440532013000
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                valid: true
                normalized: DE89370400440532013000
                countryCode: DE
                country: Germany
                checkDigits: "89"
                bban: "370400440532013000"
                metadata:
                  country: Germany
                  countryCode: DE
                  length: 22
                  currency: EUR
                  sepa: true
                  sepaInstant: true
                  bban: "370400440532013000"
                  formatted: DE89 3704 0044 0532 0130 00
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /iban/validate:
    post:
      tags:
        - IBAN
      operationId: ibanValidate
      summary: Validate one IBAN
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - iban
              properties:
                iban:
                  type: string
                  description: IBAN to validate (15-34 characters)
                includeMetadata:
                  type: boolean
                  description: Include country/BBAN metadata (default true)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /iban/validate-batch:
    post:
      tags:
        - IBAN
      operationId: ibanValidateBatch
      summary: Validate up to 100 IBANs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ibans
              properties:
                ibans:
                  type: array
                  description: JSON array or comma-separated IBANs (1-100)
                  items: {}
                includeMetadata:
                  type: boolean
                  description: Include country/BBAN metadata (default false)
            example:
              ibans:
                - DE89370400440532013000
                - GB82WEST12345698765432
                - FR7614508059891290340337066
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                summary:
                  totalProcessed: 2
                  valid: 2
                  invalid: 0
                results:
                  - index: 0
                    iban: DE89370400440532013000
                    valid: true
                    normalized: DE89370400440532013000
                  - index: 1
                    iban: GB82WEST12345698765432
                    valid: true
                    normalized: GB82WEST12345698765432
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /iban/countries:
    get:
      tags:
        - IBAN
      operationId: ibanCountries
      summary: List supported IBAN countries
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /income-tax:
    get:
      tags:
        - Income Tax
      operationId: incomeTaxEstimate
      summary: Estimate federal and state income tax
      parameters:
        - name: income
          in: query
          required: true
          description: Gross income
          schema:
            type: number
            example: 120000
        - name: filingStatus
          in: query
          required: false
          description: single (default), married_joint, or head_of_household
          schema:
            type: string
            example: single
        - name: taxYear
          in: query
          required: false
          description: Tax year (default 2024)
          schema:
            type: integer
            example: 2024
        - name: deductions
          in: query
          required: false
          description: Deductions beyond the standard deduction
          schema:
            type: number
            example: 5000
        - name: taxCredits
          in: query
          required: false
          description: Federal tax credits
          schema:
            type: number
            example: 2000
        - name: stateRate
          in: query
          required: false
          description: State tax rate percentage (0-20)
          schema:
            type: number
            example: 5.5
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                filingStatus: single
                taxableIncome: 100400
                totalFederalTax: 17663
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /income-tax/brackets:
    get:
      tags:
        - Income Tax
      operationId: incomeTaxBrackets
      summary: Get federal tax brackets
      parameters:
        - name: filingStatus
          in: query
          required: false
          description: single (default), married_joint, or head_of_household
          schema:
            type: string
            example: single
        - name: taxYear
          in: query
          required: false
          description: Tax year (default 2024)
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /income-tax/catalog:
    get:
      tags:
        - Income Tax
      operationId: incomeTaxCatalog
      summary: List supported years, filing statuses, and sources
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/validate:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesValidate
      summary: Validate a VAT number
      parameters:
        - name: vatNumber
          in: query
          required: true
          description: VAT number with country prefix
          schema:
            type: string
            example: DE123456789
        - name: checkRegistry
          in: query
          required: false
          description: Check live VIES/HMRC registration (default false)
          schema:
            type: boolean
            example: true
        - name: sellerCountryCode
          in: query
          required: false
          description: Seller country code; adds reverseChargeApplicable
          schema:
            type: string
            example: FR
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                valid: true
                normalized: DE123456789
                countryCode: DE
                nationalNumber: "123456789"
                country: Germany
                rates:
                  standard: 19
                  reduced:
                    - 7
                  superReduced: null
                  parking: null
                  zero: null
                  currency: EUR
                meta:
                  correlationId: req_abc123
                  timestamp: "2026-08-30T00:00:00.000Z"
                  processingTime: 4ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/validate/{vatNumber}:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesValidateNumber
      summary: Validate a VAT number from the URL path
      parameters:
        - name: vatNumber
          in: path
          required: true
          description: VAT number with country prefix
          schema:
            type: string
            example: DE123456789
        - name: checkRegistry
          in: query
          required: false
          description: Check live VIES/HMRC registration (default false)
          schema:
            type: boolean
            example: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/validate-batch:
    post:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesValidateBatch
      summary: Validate up to 50 VAT numbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vatNumbers
              properties:
                vatNumbers:
                  type: array
                  description: JSON array or comma-separated VAT numbers (1-50)
                  items: {}
                checkRegistry:
                  type: boolean
                  description: Check live VIES/HMRC registration (default false)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesValidateBatchGet
      summary: Validate up to 50 comma-separated VAT numbers via GET
      parameters:
        - name: vatNumbers
          in: query
          required: true
          description: Comma-separated VAT numbers (1-50)
          schema:
            type: string
            example: DE123456789,FR40303265045
        - name: checkRegistry
          in: query
          required: false
          description: Check live VIES/HMRC registration (default false)
          schema:
            type: boolean
            example: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                summary:
                  totalProcessed: 2
                  valid: 2
                  invalid: 0
                results:
                  - index: 0
                    vatNumber: DE123456789
                    valid: true
                    normalized: DE123456789
                    countryCode: DE
                    nationalNumber: "123456789"
                    country: Germany
                  - index: 1
                    vatNumber: FR40303265045
                    valid: true
                    normalized: FR40303265045
                    countryCode: FR
                    nationalNumber: "40303265045"
                    country: France
                meta:
                  correlationId: req_abc123
                  timestamp: "2026-08-30T00:00:00.000Z"
                  processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/calculate:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesCalculate
      summary: Calculate VAT for an amount
      parameters:
        - name: amount
          in: query
          required: true
          description: Positive amount
          schema:
            type: number
            example: 100
        - name: countryCode
          in: query
          required: true
          description: Two-letter country code
          schema:
            type: string
            example: DE
        - name: category
          in: query
          required: false
          description: "Rate category: standard (default), reduced, reduced2, superReduced, parking, or zero"
          schema:
            type: string
            example: reduced
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/calculate-batch:
    post:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesCalculateBatch
      summary: Calculate VAT for multiple amounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - conversions
              properties:
                conversions:
                  type: array
                  description: JSON array of {"amount","countryCode","category"} objects
                  items: {}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesCalculateBatchGet
      summary: Calculate VAT for multiple amounts via GET
      parameters:
        - name: conversions
          in: query
          required: true
          description: JSON-encoded array of {"amount","countryCode","category"} objects
          schema:
            type: string
            example: "[{\"amount\":100,\"countryCode\":\"DE\"}]"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/rates/{countryCode}:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesRates
      summary: Get VAT rates for a country
      parameters:
        - name: countryCode
          in: path
          required: true
          description: Two-letter country code
          schema:
            type: string
            example: DE
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/rates/countries:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesRateCountries
      summary: List countries with VAT rate data
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /vat-validation-and-rates/catalog:
    get:
      tags:
        - VAT Validation And Rates
      operationId: vatValidationAndRatesCatalog
      summary: List supported countries, categories, and limits
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /color-convert:
    get:
      tags:
        - Color Convert
      operationId: colorConvertConvert
      summary: Convert a color and optionally check contrast
      parameters:
        - name: color
          in: query
          required: true
          description: Color in any supported format (hex, rgb, hsl, name)
          schema:
            type: string
            example: "#3B82F6"
        - name: contrast_with
          in: query
          required: false
          description: Background color for contrast checks
          schema:
            type: string
            example: "#FFFFFF"
        - name: gradient_angle
          in: query
          required: false
          description: Gradient angle (-360 to 360, default 90)
          schema:
            type: number
            example: 135
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                color:
                  oklab:
                    l: 0.61
                    a: -0.04
                    b: -0.15
                  oklch:
                    l: 0.61
                    c: 0.16
                    h: 255
                contrast:
                  apca:
                    standard: APCA-W3 0.0.98G-4g
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-13T12:00:00.000Z"
                processingTime: 8ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /data-format-convert/convert:
    post:
      tags:
        - Data Format Convert
      operationId: dataFormatConvertConvert
      summary: Convert data from one format to another
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - inputFormat
                - outputFormat
                - data
              properties:
                inputFormat:
                  type: string
                  description: Input format
                outputFormat:
                  type: string
                  description: Output format
                data:
                  type: string
                  description: Input data as a string (use --stdin to send JSON objects)
                options:
                  type: object
                  description: Conversion options JSON (delimiter, pretty, xmlRoot, ...)
            example:
              inputFormat: json
              outputFormat: csv
              data:
                - id: 1
                  name: Ada
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                inputFormat: json
                outputFormat: csv
                recordCount: 1
                conversionMetadata:
                  columns:
                    - id
                    - name
                  outputBytes: 18
                data: id,name\n1,Ada
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-13T12:00:00.000Z"
                processingTime: 4ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /deslop/rules:
    get:
      tags:
        - Deslop
      operationId: deslopRules
      summary: List detection rules
      parameters:
        - name: layer
          in: query
          required: false
          description: Rule layer (1-5)
          schema:
            type: integer
            example: 1
        - name: category
          in: query
          required: false
          description: Rule category
          schema:
            type: string
            example: filler
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /deslop/analyze:
    post:
      tags:
        - Deslop
      operationId: deslopAnalyze
      summary: Analyze text for AI writing patterns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: Text to process (up to 200,000 characters)
                format:
                  type: string
                  description: text (default) or markdown
                profile:
                  type: string
                  description: Rule profile name
                categories:
                  type: array
                  description: Rule categories to apply (JSON array or comma-separated)
                  items: {}
                ignore:
                  type: array
                  description: Rule IDs to ignore (JSON array or comma-separated)
                  items: {}
                preserve:
                  type: array
                  description: Content to preserve (JSON array or comma-separated)
                  items: {}
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    get:
      tags:
        - Deslop
      operationId: deslopAnalyzeGet
      summary: Analyze short text via GET
      parameters:
        - name: text
          in: query
          required: true
          description: Text to analyze (short; use analyze for long text)
          schema:
            type: string
            example: We delve into synergy.
        - name: format
          in: query
          required: false
          description: text (default) or markdown
          schema:
            type: string
            example: text
        - name: profile
          in: query
          required: false
          description: Rule profile name
          schema:
            type: string
            example: default
        - name: categories
          in: query
          required: false
          description: Comma-separated rule categories
          schema:
            type: string
            example: filler
        - name: ignore
          in: query
          required: false
          description: Comma-separated rule IDs to ignore
          schema:
            type: string
            example: em-dash
        - name: preserve
          in: query
          required: false
          description: Comma-separated content to preserve
          schema:
            type: string
            example: code
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /deslop/rewrite:
    post:
      tags:
        - Deslop
      operationId: deslopRewrite
      summary: Rewrite text to remove AI writing patterns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: Text to process (up to 200,000 characters)
                format:
                  type: string
                  description: text (default) or markdown
                profile:
                  type: string
                  description: Rule profile name
                categories:
                  type: array
                  description: Rule categories to apply (JSON array or comma-separated)
                  items: {}
                ignore:
                  type: array
                  description: Rule IDs to ignore (JSON array or comma-separated)
                  items: {}
                preserve:
                  type: array
                  description: Content to preserve (JSON array or comma-separated)
                  items: {}
                mode:
                  type: string
                  description: light, balanced (default), or strict
            example:
              text: It turns out we must leverage a very robust solution.
              profile: technical
              mode: balanced
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                textClean: We must use a strong solution.
                changesApplied: 3
                rulesVersion: 1.0.0
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-13T12:00:00.000Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /diffy/snapshot:
    post:
      tags:
        - Diffy
      operationId: diffySnapshot
      summary: Capture a page snapshot and its diffable state
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: Public HTTP(S) page URL
                render:
                  type: string
                  description: auto (default), static, or browser
                max_chars:
                  type: integer
                  description: Max output characters (1000-100000, default 20000)
                format:
                  type: string
                  description: markdown (default), blocks, or tree
                include_state:
                  type: boolean
                  description: Include state for later diffs (default true)
            example:
              url: https://example.com/pricing
              format: markdown
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                url: https://example.com/pricing
                title: Pricing
                format: markdown
                content: |-
                  # Pricing
                  ...
                truncated: false
                state:
                  schema: 1
                  captured_at: "2026-06-10T17:00:00.000Z"
                  url: https://example.com/pricing
                  blocks:
                    - h: 9f2a1c44d0e88b31
                      t: h1
                      x: Pricing
                state_etag: 9f2a1c44d0e8...
                metadata:
                  render_mode: static
                  timing_ms: 412
                  redirect_count: 0
                  blocks: 38
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /diffy/diff:
    post:
      tags:
        - Diffy
      operationId: diffyDiff
      summary: Diff a page against a previous snapshot state
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - previous_state
              properties:
                url:
                  type: string
                  description: Public HTTP(S) page URL
                render:
                  type: string
                  description: auto (default), static, or browser
                max_chars:
                  type: integer
                  description: Max output characters (1000-100000, default 20000)
                previous_state:
                  type: object
                  description: State JSON returned by snapshot
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /encoding-convert:
    get:
      tags:
        - Encoding Convert
      operationId: encodingConvertCatalog
      summary: List supported operations, encodings, and algorithms
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Encoding Convert
      operationId: encodingConvertConvert
      summary: Run an encoding operation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operation
                - input
              properties:
                operation:
                  type: string
                  description: encode, decode, hash, jwt_decode, normalize, data_uri_encode, or data_uri_decode
                input:
                  type: string
                  description: Text, encoded value, JWT, or data URI
                encoding:
                  type: string
                  description: base64, base64url, base32, hex, url, html-entity, or punycode
                algorithm:
                  type: string
                  description: Hash algorithm
                output:
                  type: string
                  description: "Hash output: hex, base64, or base64url"
                form:
                  type: string
                  description: "Unicode form: NFC, NFD, NFKC, or NFKD"
                mime_type:
                  type: string
                  description: Data URI MIME type
            example:
              operation: encode
              encoding: base64url
              input: Hello, world!
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                operation: encode
                result: SGVsbG8sIHdvcmxkIQ
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-13T12:00:00.000Z"
                processingTime: 2ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /lorem-ipsum/generate:
    get:
      tags:
        - Lorem Ipsum
      operationId: loremIpsumGenerate
      summary: Generate lorem ipsum words, sentences, or paragraphs
      parameters:
        - name: units
          in: query
          required: false
          description: words, sentences, or paragraphs (default)
          schema:
            type: string
            example: sentences
        - name: amount
          in: query
          required: false
          description: Number of units (default 3)
          schema:
            type: integer
            example: 5
        - name: length
          in: query
          required: false
          description: short, medium (default), long, or verylong
          schema:
            type: string
            example: short
        - name: format
          in: query
          required: false
          description: json (default), text, or html
          schema:
            type: string
            example: json
        - name: startWithLorem
          in: query
          required: false
          description: Start with 'Lorem ipsum' (default true)
          schema:
            type: boolean
            example: false
        - name: seed
          in: query
          required: false
          description: Seed for deterministic output
          schema:
            type: string
            example: demo
        - name: maxLength
          in: query
          required: false
          description: Maximum output characters
          schema:
            type: integer
            example: 500
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/capabilities:
    get:
      tags:
        - Markdown Convert
      operationId: markdownConvertCapabilities
      summary: List supported targets, limits, and Markdown flavor
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/to-html:
    post:
      tags:
        - Markdown Convert
      operationId: markdownConvertToHtml
      summary: Render Markdown to sanitized HTML
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - markdown
              properties:
                markdown:
                  type: string
                  description: Markdown input
                allowRawHtml:
                  type: boolean
                  description: Allow raw HTML (default false)
                breaks:
                  type: boolean
                  description: Convert newlines to <br> (default false)
                linkify:
                  type: boolean
                  description: Autolink URLs (default true)
            example:
              markdown: "# Release Notes"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                html: |
                  <h1 id="release-notes">Release Notes</h1>
                frontMatter: null
                headings:
                  - level: 1
                    text: Release Notes
                    slug: release-notes
                    line: 1
                stats:
                  inputBytes: 16
                  durationMs: 2
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/to-markdown:
    post:
      tags:
        - Markdown Convert
      operationId: markdownConvertToMarkdown
      summary: Convert HTML to Markdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - html
              properties:
                html:
                  type: string
                  description: HTML input
                headingStyle:
                  type: string
                  description: atx (default) or setext
                bulletMarker:
                  type: string
                  description: "Bullet marker: -, *, or +"
                codeBlockStyle:
                  type: string
                  description: fenced (default) or indented
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/to-text:
    post:
      tags:
        - Markdown Convert
      operationId: markdownConvertToText
      summary: Render Markdown or HTML to plaintext
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                markdown:
                  type: string
                  description: Markdown input (or pass --html)
                html:
                  type: string
                  description: HTML input (or pass --markdown)
                wrap:
                  type: integer
                  description: Wrap column (0-200, default 0 = no wrap)
                includeLinkUrls:
                  type: boolean
                  description: Include link URLs (default false)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/outline:
    post:
      tags:
        - Markdown Convert
      operationId: markdownConvertOutline
      summary: Get document structure and statistics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                markdown:
                  type: string
                  description: Markdown input (or pass --html)
                html:
                  type: string
                  description: HTML input (or pass --markdown)
                tocMinLevel:
                  type: integer
                  description: Minimum heading level (default 1)
                tocMaxLevel:
                  type: integer
                  description: Maximum heading level (default 6)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /markdown-convert/batch:
    post:
      tags:
        - Markdown Convert
      operationId: markdownConvertBatch
      summary: Process up to 25 documents in one request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - documents
              properties:
                documents:
                  type: array
                  description: JSON array of {"target","markdown"|"html"} documents
                  items: {}
            example:
              documents:
                - id: "1"
                  target: html
                  markdown: "# A"
                - id: "2"
                  target: text
                  html: <p>b</p>
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - id: "1"
                    target: html
                    success: true
                    html: |
                      <h1 id="a">A</h1>
                  - id: "2"
                    target: text
                    success: true
                    text: b
                    wordCount: 1
                summary:
                  total: 2
                  succeeded: 2
                  failed: 0
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /translate:
    post:
      tags:
        - Translate
      operationId: translateText
      summary: Translate one text or a batch of texts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - targetLang
              properties:
                targetLang:
                  type: string
                  description: Target language code
                text:
                  type: string
                  description: Text to translate (or pass --texts)
                texts:
                  type: array
                  description: JSON array or comma-separated texts to translate
                  items: {}
                sourceLang:
                  type: string
                  description: Source language code (default auto)
            example:
              text: Hello world
              targetLang: es
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                translations:
                  - translatedText: Hola mundo
                    detectedSourceLang: en
                model: m2m100-1.2b-int8
                charsProcessed: 11
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /translate/languages:
    get:
      tags:
        - Translate
      operationId: translateLanguages
      summary: List supported languages
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-convert/formats:
    get:
      tags:
        - Document Convert
      operationId: documentConvertFormats
      summary: List supported conversion pairs
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-convert/convert:
    post:
      tags:
        - Document Convert
      operationId: documentConvertConvert
      summary: Convert one document from a local file or URL
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - sourceFormat
                - targetFormat
              properties:
                sourceFormat:
                  type: string
                  description: Source format
                targetFormat:
                  type: string
                  description: Target format
                fileBase64:
                  type: string
                  description: Local file to upload (or pass --file-url)
                fileUrl:
                  type: string
                  description: Public HTTP(S) file URL (or pass --file)
                filename:
                  type: string
                  description: Original filename
            example:
              sourceFormat: html
              targetFormat: docx
              fileBase64: PGgxPkhlbGxvPC9oMT4=
              filename: note.html
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                sourceFormat: html
                targetFormat: docx
                mimeType: application/vnd.openxmlformats-officedocument.wordprocessingml.document
                filename: note.docx
                fileBase64: UEsDBBQAAAAI...
                engine: html-to-docx
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/documents:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationDocuments
      summary: List available document types
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/openapi.json:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationOpenapi
      summary: Get the service OpenAPI document
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/{documentType}/schema:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationSchema
      summary: Get a document type's field schema
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/{documentType}/json-schema:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationJsonSchema
      summary: Get a document type's JSON Schema
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/{documentType}/example:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationExample
      summary: Get example data for a document type
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/{documentType}/render:
    get:
      tags:
        - Document Generation
      operationId: documentGenerationRenderBlank
      summary: Render a blank document as HTML
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Document Generation
      operationId: documentGenerationRender
      summary: Render a document with data as HTML
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  type: string
                  description: filled (default) or blank
                data:
                  type: object
                  description: Document data JSON (see the type's schema/example)
                branding:
                  type: object
                  description: Branding JSON (organizationName, primaryColor, footerText, ...)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/{documentType}/generate:
    post:
      tags:
        - Document Generation
      operationId: documentGenerationGenerate
      summary: Generate a PDF or DOCX document
      parameters:
        - name: documentType
          in: path
          required: true
          description: Document type slug (see documents)
          schema:
            type: string
            example: invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  type: string
                  description: filled (default) or blank
                data:
                  type: object
                  description: Document data JSON (see the type's schema/example)
                branding:
                  type: object
                  description: Branding JSON (organizationName, primaryColor, footerText, ...)
                output:
                  type: object
                  description: "Output JSON: {\"type\":\"pdf|docx\",\"format\":\"Letter\",\"responseType\":\"base64|binary\",\"landscape\":false}"
            example:
              mode: filled
              templateVersion: 1.0.0
              data:
                invoiceNumber: INV-2026-0042
                invoiceDate: "2026-09-02"
                dueDate: "2026-10-02"
                sellerName: Datpaq
                customerName: Example Corporation
                currency: USD
                taxRate: 0
                items:
                  - description: API Platform Subscription
                    quantity: 1
                    unitPrice: 499
              output:
                type: docx
                responseType: base64
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                docxBase64: UEsDB...
                documentMetadata:
                  documentType: invoice
                  templateVersion: 1.0.0
                  mode: filled
                  format: DOCX
                  byteLength: 12345
                  timingMs: 120
                metadata:
                  correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /document-generation/batch:
    post:
      tags:
        - Document Generation
      operationId: documentGenerationBatch
      summary: Generate up to 5 documents as base64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - requests
              properties:
                requests:
                  type: array
                  description: JSON array of {"documentType","data","output"} requests (1-5)
                  items: {}
            example:
              requests:
                - documentType: employment-verification
                  mode: blank
                  branding:
                    logoText: Example Co
                    primaryColor: "#225588"
                    accentColor: "#882255"
                  output:
                    type: html
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                total: 1
                failed: 0
                results:
                  - index: 0
                    success: true
                    documentType: employment-verification
                    templateVersion: 1.0.0
                    outputType: html
                    html: <!doctype html>...
                metadata:
                  correlationId: req_batch123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ocr/parse:
    post:
      tags:
        - OCR
      operationId: ocrParse
      summary: Extract text from a local file or URL
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fileBase64:
                  type: string
                  description: Local PDF or image (or pass --url)
                url:
                  type: string
                  description: Public HTTP(S) file URL (or pass --file)
                filename:
                  type: string
                  description: Original filename
                ocr:
                  type: boolean
                  description: Force OCR on images and scanned pages (default false)
                language:
                  type: string
                  description: OCR language code (default eng)
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /pdf-toolkit:
    get:
      tags:
        - PDF Toolkit
      operationId: pdfToolkitCatalog
      summary: List supported operations and limits
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - PDF Toolkit
      operationId: pdfToolkitRun
      summary: Run a PDF operation on local files
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operation
              properties:
                operation:
                  type: string
                  description: merge, split, extract, rotate, watermark, compress, encrypt, or inspect
                file:
                  type: string
                  description: Local PDF for non-merge operations
                files:
                  type: array
                  description: Comma-separated local PDFs for merge (2-20)
                  items: {}
                pages:
                  type: string
                  description: "Pages: all or ascending ranges"
                angle:
                  type: number
                  description: "Rotate: multiple of 90; watermark: any angle"
                text:
                  type: string
                  description: Watermark text (1-200 characters)
                opacity:
                  type: number
                  description: Watermark opacity 0-1 (default 0.6)
                color:
                  type: string
                  description: Watermark RGB as three numbers 0-1
                fontSize:
                  type: number
                  description: Watermark font size (8-300)
                password:
                  type: string
                  description: "Encrypt: user password (8+ characters)"
                owner_password:
                  type: string
                  description: "Encrypt: owner password"
            example:
              operation: inspect
              file: <base64-pdf>
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                operation: inspect
                result:
                  size: 4821
                  pages: 1
                  pdfVersion: "1.4"
                  encrypted: false
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-13T12:00:00.000Z"
                processingTime: 42ms
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /breach-check/check:
    get:
      tags:
        - Breach Check
      operationId: breachCheckCheck
      summary: Check one email for known breaches
      parameters:
        - name: email
          in: query
          required: true
          description: Email address
          schema:
            type: string
            example: test@example.com
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                email: user@example.com
                breached: true
                breachCount: 1
                breaches:
                  - name: Adobe
                    title: Adobe
                    domain: adobe.com
                    breachDate: "2013-10-04"
                    pwnCount: 152445165
                    dataClasses:
                      - Email addresses
                      - Passwords
                    isVerified: true
                    isSensitive: false
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    post:
      tags:
        - Breach Check
      operationId: breachCheckCheckBatch
      summary: Check up to 25 emails for known breaches
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - emails
              properties:
                emails:
                  type: array
                  description: JSON array or comma-separated emails (1-25)
                  items: {}
            example:
              emails:
                - user@example.com
                - clean@example.com
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                results:
                  - success: true
                    email: user@example.com
                    breached: true
                    breachCount: 1
                    breaches: []
                summary:
                  total: 2
                  breached: 1
                  clean: 1
                  failed: 0
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /breach-check/password:
    get:
      tags:
        - Breach Check
      operationId: breachCheckPassword
      summary: Check a SHA-1 hash prefix against breached passwords
      parameters:
        - name: hash_prefix
          in: query
          required: true
          description: First 5 hex characters of the password's SHA-1
          schema:
            type: string
            example: 5BAA6
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /breach-check/breaches:
    get:
      tags:
        - Breach Check
      operationId: breachCheckBreaches
      summary: List known breaches
      parameters:
        - name: domain
          in: query
          required: false
          description: Filter by breached domain
          schema:
            type: string
            example: adobe.com
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /logo/discover:
    get:
      tags:
        - Logo
      operationId: logoDiscover
      summary: Discover logos and brand colors for a domain
      parameters:
        - name: domain
          in: query
          required: true
          description: Company domain
          schema:
            type: string
            example: stripe.com
        - name: includePalette
          in: query
          required: false
          description: Include brand color palette (default true)
          schema:
            type: boolean
            example: false
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                domain: example.com
                found: true
                sourceUrl: https://example.com/favicon.ico
                imageBase64: <base64>
                byteLength: 4096
                palette:
                  dominant: "#1a1a1a"
                  colors:
                    - hex: "#1a1a1a"
                      rgb:
                        r: 26
                        g: 26
                        b: 26
                      weight: 0.62
                  width: 64
                  height: 64
                sourcesTried:
                  - url: https://example.com/favicon.ico
                    ok: true
                    status: 200
                    fromCache: false
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-12T00:00:00.000Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ping-human/escalations:
    post:
      tags:
        - Ping Human
      operationId: pingHumanCreate
      summary: Create an escalation and notify humans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - context
                - channels
              properties:
                title:
                  type: string
                  description: Short title (1-200 characters)
                context:
                  type: string
                  description: Decision context (1-8000 characters)
                channels:
                  type: array
                  description: JSON array of {"type":"email","to":...} or {"type":"slack","webhook_url":...} (1-3)
                  items: {}
                options:
                  type: array
                  description: JSON array of {"id","label"} choices (2-6)
                  items: {}
                fields:
                  type: array
                  description: JSON array of {"name","type","label","required"} inputs (max 5)
                  items: {}
                ttl_seconds:
                  type: integer
                  description: Expiry in seconds (60-86400, default 3600)
                callback:
                  type: object
                  description: Callback JSON {"url","secret"} for signed reply delivery
            example:
              title: Approve refund over $500?
              context: "Customer #1042 requests $750 refund..."
              options:
                - id: approve
                  label: Approve
                - id: deny
                  label: Deny
              channels:
                - type: email
                  to: ops@example.com
              ttl_seconds: 7200
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                id: esc_8f4b1c2d
                status: pending
                poll_url: /api/v1/ping-human/escalations/esc_8f4b1c2d
                expires_at: "2026-06-10T18:00:00.000Z"
                poll_interval_seconds: 5
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /ping-human/escalations/{id}:
    get:
      tags:
        - Ping Human
      operationId: pingHumanGet
      summary: Get an escalation's status and reply
      parameters:
        - name: id
          in: path
          required: true
          description: Escalation ID
          schema:
            type: string
            example: esc_123
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
    delete:
      tags:
        - Ping Human
      operationId: pingHumanCancel
      summary: Cancel an open escalation
      parameters:
        - name: id
          in: path
          required: true
          description: Escalation ID
          schema:
            type: string
            example: esc_123
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /structured-extraction/extract:
    post:
      tags:
        - Structured Extraction
      operationId: structuredExtractionExtract
      summary: Extract fields from a URL or HTML
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - selectors
              properties:
                selectors:
                  type: object
                  description: Selector map JSON, e.g. {"title":"h1"}
                url:
                  type: string
                  description: Public HTTP(S) page URL (or pass --html)
                html:
                  type: string
                  description: Raw HTML (or pass --url)
            example:
              url: https://example.com/product
              selectors:
                title: h1.product-title
                price: .price
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                data:
                  title: Amazing Widget
                  price: $29.99
                metadata:
                  timingMs: 12
                  fromCache: false
                correlationId: req_abc123
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
  /tech-stack-detection/detect:
    get:
      tags:
        - Tech Stack Detection
      operationId: techStackDetectionDetect
      summary: Detect technologies for a domain
      parameters:
        - name: domain
          in: query
          required: true
          description: Domain to analyze
          schema:
            type: string
            example: example.com
        - name: url
          in: query
          required: false
          description: Specific page URL to analyze
          schema:
            type: string
            example: https://example.com/pricing
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GenericSuccess"
              example:
                success: true
                domain: wordpress.org
                url: https://wordpress.org/
                httpStatus: 200
                technologies:
                  - name: WordPress
                    categories:
                      - CMS
                    confidence: 80
                    evidence:
                      - meta:generator
                technologyCount: 1
                categories:
                  CMS: 1
                fromCache: false
                durationMs: 612
                correlationId: req_abc123
                metadata: {}
                updatedAt: "2026-09-12T00:00:00.000Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/ServiceUnavailable"
components:
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key passed via x-api-key request header
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: API key passed as api_key query parameter
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    RateLimited:
      description: Rate limit exceeded — retry after the indicated period
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
          example: Invalid API key
        correlationId:
          type: string
          description: Request tracking identifier for support
          example: abc123-def456-789ghi
        service:
          type: string
          description: Service name that produced the error
          example: ip-geolocation
    GenericSuccess:
      type: object
      description: Standard success envelope. The data property structure varies by endpoint.
      properties:
        correlationId:
          type: string
          description: Request tracking identifier
          example: abc123-def456
        data:
          type: object
          description: Response payload (structure varies by endpoint)
        cached:
          type: boolean
          description: Whether the response was served from cache
          example: false
