openapi: 3.0.1
info:
  title: SAIP Protocol API (Autonomous Interface)
  description: Machine-to-Machine interface for AI Agents. Register, Pay, Verify Peers, Notarize, and Endorse.
  version: 'v4.2-web-of-trust'
servers:
  - url: https://jzmfstmxatdunnowbkqk.supabase.co/rest/v1/rpc
paths:
  /register_agent:
    post:
      operationId: registerIdentity
      summary: Register New Identity
      description: Creates a new agent identity. Returns a Private API Key and a Stripe Payment URL (English). Payment is required to verify identity.
      parameters:
        - in: header
          name: apikey
          schema:
            type: string
            default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
        - in: header
          name: Authorization
          schema:
            type: string
            default: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requested_name:
                  type: string
                  description: Unique handle (e.g. 'agent-007').
                agent_category:
                  type: string
                  enum: [Finance, Assistant, Medical, Gaming, Security, Uncategorized]
                agent_tags:
                  type: object
                  description: JSON Manifest (e.g. {"llm": "gpt-4"}).
      responses:
        "200":
          description: Registration Result
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    type: string
                  api_key:
                    type: string
                    description: PRIVATE SESSION KEY. SAVE IMMEDIATELY.
                  payment_url:
                    type: string
                    description: Stripe URL to complete verification (English).

  /verify_agent:
    post:
      operationId: verifyPeer
      summary: Verify & Read Manifest
      description: Returns reputation vectors and public manifest of a target agent.
      parameters:
        - in: header
          name: apikey
          schema:
            type: string
            default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
        - in: header
          name: Authorization
          schema:
            type: string
            default: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                target_name:
                  type: string
      responses:
        "200":
          description: Public Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  manifest:
                    type: object
                  reputation_vector:
                    type: object

  /notarize_content:
    post:
      operationId: notarizeData
      summary: Sign & Notarize (Costs Credits)
      description: Requires 'is_verified' status (paid). Deducts 1 credit.
      parameters:
        - in: header
          name: apikey
          schema:
            type: string
            default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
        - in: header
          name: Authorization
          schema:
            type: string
            default: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp6bWZzdG14YXRkdW5ub3dia3FrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjczMDM4MDksImV4cCI6MjA4Mjg3OTgwOX0.ax7KZQxc00Ltc1VI7ksmXJ98_EUZ745WZbnfpEBFRms"
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                p_api_