openapi: 3.1.0
info:
  title: sAI Agent API
  version: 2.1.0
  description: Public MCP/A2A endpoints for sAI, ERC-8004 Agent #2193 on Base.
servers:
  - url: https://sai-agent-server.vercel.app
paths:
  /api/health:
    get:
      summary: Health and endpoint discovery
      responses:
        '200':
          description: Agent health status
  /api/mcp:
    post:
      summary: MCP JSON-RPC endpoint
      description: Supports initialize, tools/list, and tools/call.
      responses:
        '200':
          description: MCP response
        '402':
          description: x402 payment required for premium tools
  /api/a2a:
    post:
      summary: Agent-to-agent task endpoint
      responses:
        '200':
          description: A2A task result
        '402':
          description: x402 payment required for premium tasks
  /.well-known/agent-card.json:
    get:
      summary: A2A agent card
      responses:
        '200':
          description: Agent card JSON
  /.well-known/agent-registration.json:
    get:
      summary: ERC-8004 domain registration proof
      responses:
        '200':
          description: Registration JSON
components:
  schemas:
    MCPRequest:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
            - type: string
            - type: number
        method:
          type: string
          enum: [initialize, tools/list, tools/call]
        params:
          type: object
    A2ARequest:
      type: object
      properties:
        task:
          type: string
        parameters:
          type: object
        agentId:
          type: string
        sessionId:
          type: string
