openapi: 3.1.0
info:
  title: iAgentPay API (Shipping Q3 2026)
  description: |
    iAgentPay is the treasury layer above x402 V2. Shipping Q3 2026 at https://api.pay.ijarvis.ai/v1/.
    Anchor product of the iJarvis Agent Stack. Until launch, endpoints return 503.
  version: v1-preview
  contact:
    name: iJarvis LLC
    email: hello@pay.ijarvis.ai
    url: https://ijarvis.ai
  license:
    name: Proprietary (API access under iAgentPay Terms of Service)
    url: https://pay.ijarvis.ai/terms
servers:
  - url: https://api.pay.ijarvis.ai/v1
    description: Planned production API (Q3 2026)
security:
  - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API-Key
paths:
  /status:
    get:
      summary: Service health check
      responses:
        '200': {description: Service healthy}
  /payments:
    post:
      summary: Route a payment through iAgentPay treasury (x402 V2 settlement under the hood)
      responses:
        '200': {description: Payment routed successfully}
        '402': {description: Budget exceeded or counterparty blocked}
        '429': {description: Rate limit exceeded}
  /payments/{txId}:
    get:
      summary: Retrieve a routed payment record
      parameters:
        - {name: txId, in: path, required: true, schema: {type: string}}
      responses:
        '200': {description: Payment record}
  /budgets:
    get:
      summary: List budget configurations for the authenticated operator
      responses:
        '200': {description: Budget list}
    post:
      summary: Create or update a budget (per-hour, per-day, per-counterparty limits)
      responses:
        '200': {description: Budget updated}
  /counterparties:
    get:
      summary: List counterparties with risk signals (iAgentFi ratings + iAgentLog behavior)
      responses:
        '200': {description: Counterparty ledger}
  /anomalies:
    get:
      summary: Query detected spend anomalies
      responses:
        '200': {description: Anomalies list}
  /treasury:
    get:
      summary: Treasury analytics dashboard data
      responses:
        '200': {description: Analytics payload}
