openapi: 3.0.3
info:
  title: AgentAPI
  description: Structured data endpoints built for AI agents. Legal data for all 50 US states, computation verification, salary ranges, health triage, and document templates.
  version: 1.0.0
  contact:
    email: ted.mtsolutions@gmail.com
servers:
  - url: https://xingig.com/api/v1
paths:
  /:
    get:
      operationId: getApiDirectory
      summary: Get full API directory with all endpoints and examples
      responses:
        '200':
          description: API directory
  /legal/llc/{state}:
    get:
      operationId: getLlcRequirements
      summary: Get LLC formation requirements for a US state
      parameters:
        - name: state
          in: path
          required: true
          schema:
            type: string
          description: Two-letter state code (e.g., AZ, CA, TX, NY, FL). All 50 states + DC supported.
      responses:
        '200':
          description: LLC formation data including filing fee, steps, timeline, URLs
  /legal/security-deposit/{state}:
    get:
      operationId: getSecurityDepositRules
      summary: Get security deposit rules by state
      parameters:
        - name: state
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Deposit limits, return timeline, deduction rules
  /legal/small-claims/{state}:
    get:
      operationId: getSmallClaimsInfo
      summary: Get small claims court limits and rules by state
      parameters:
        - name: state
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Court limits, filing fees, attorney rules
  /calc/{type}:
    get:
      operationId: calculate
      summary: Perform a calculation for verification
      parameters:
        - name: type
          in: path
          required: true
          schema:
            type: string
            enum: [mortgage, compound_interest, loan_payment, tip, bmi, convert, percentage]
        - name: price
          in: query
          schema: { type: number }
          description: Home price (mortgage)
        - name: down_pct
          in: query
          schema: { type: number }
          description: Down payment percentage (mortgage)
        - name: rate
          in: query
          schema: { type: number }
          description: Interest rate percentage
        - name: term_years
          in: query
          schema: { type: number }
        - name: principal
          in: query
          schema: { type: number }
          description: Starting principal (compound_interest)
        - name: years
          in: query
          schema: { type: number }
        - name: monthly_contribution
          in: query
          schema: { type: number }
        - name: amount
          in: query
          schema: { type: number }
          description: Loan amount (loan_payment)
        - name: bill
          in: query
          schema: { type: number }
          description: Bill amount (tip)
        - name: tip_pct
          in: query
          schema: { type: number }
        - name: split
          in: query
          schema: { type: number }
        - name: weight_lbs
          in: query
          schema: { type: number }
        - name: height_inches
          in: query
          schema: { type: number }
        - name: value
          in: query
          schema: { type: number }
          description: Value to convert
        - name: from
          in: query
          schema: { type: string }
          description: "Convert from unit (f,c,k,lb,kg,oz,g,in,ft,mi,km,cm,gal,l,cup,floz)"
        - name: to
          in: query
          schema: { type: string }
          description: Convert to unit
        - name: percent
          in: query
          schema: { type: number }
        - name: of
          in: query
          schema: { type: number }
      responses:
        '200':
          description: Calculation result with inputs echoed back
  /salary/{role}:
    get:
      operationId: getSalaryData
      summary: Get salary ranges by role with optional metro adjustment
      parameters:
        - name: role
          in: path
          required: true
          schema:
            type: string
            enum: [software_engineer, data_scientist, product_manager, registered_nurse, marketing_manager, accountant, ux_designer, cybersecurity, electrician, teacher_k12]
        - name: metro
          in: query
          schema:
            type: string
            enum: [sf, nyc, seattle, austin, phoenix]
          description: Metro area for adjusted salary range
      responses:
        '200':
          description: Salary ranges (entry/mid/senior), demand, growth outlook
  /health/{symptom}:
    get:
      operationId: getHealthTriage
      summary: Get symptom triage information
      parameters:
        - name: symptom
          in: path
          required: true
          schema:
            type: string
            enum: [headache, chest_pain, back_pain, fever, stomach_pain]
      responses:
        '200':
          description: Severity, causes, remedies, when to see doctor
  /templates:
    get:
      operationId: listTemplates
      summary: List available document templates
      responses:
        '200':
          description: List of template IDs and descriptions
  /templates/{id}:
    get:
      operationId: getTemplate
      summary: Get document template details and required fields
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            enum: [demand_letter, invoice, nda, independent_contractor, lease_termination]
      responses:
        '200':
          description: Template fields, notes, and schema
