{
  "openapi": "3.1.0",
  "info": {
    "title": "Saylor Innovations Knowledge Base — Agent API",
    "version": "1.1.0",
    "summary": "Machine-payable technical guides. No signup, no API key, no account.",
    "description": "Search and read practical technical guides. Metadata and search are free. Guide bodies are sold per-article over x402 (HTTP 402 + X-PAYMENT), settled in USDC/USDT/SOL on Solana or USDC on Base.\n\nFlow: GET /api/search to find guides -> GET /api/kb?id={id} -> receive 402 with payment requirements -> pay -> retry with X-PAYMENT -> receive the body.\n\nIMPORTANT: settlement is not instant. After paying, retry the request. It typically takes 3-4 attempts over 10-20 seconds. A 402 saying \"payment not found on-chain yet\" means keep retrying — it does not mean the payment failed.",
    "contact": {
      "email": "saylorinnovations@gmail.com",
      "url": "https://saylorinnovations.com"
    },
    "license": {
      "name": "LicenseRef-Saylor-Agent-Use-1.0"
    }
  },
  "servers": [
    {
      "url": "https://saylorinnovations.com"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchGuides",
        "summary": "Search the catalog. Free, no payment.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Free-text query over title, tags, category, summary, teaser."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "AI & Agents",
                "Content & Growth",
                "Crypto Basics",
                "IoT & Hardware",
                "Linux & Systems",
                "On-chain & DeFi",
                "Security & OpSec",
                "Web & Domains"
              ]
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated; all must match."
          },
          {
            "name": "difficulty",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "advanced",
                "beginner",
                "intermediate"
              ]
            }
          },
          {
            "name": "free",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Only guides with no price."
          },
          {
            "name": "maxPrice",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Atomic USDC cap."
          },
          {
            "name": "maxReadMins",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked results plus facets.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "facets": {
                      "type": "object"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "difficulty": {
                            "type": "string"
                          },
                          "readMins": {
                            "type": "integer"
                          },
                          "teaser": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "price": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Atomic USDC (6 dp). 10000 = $0.01. null = free."
                          },
                          "license": {
                            "type": "string"
                          },
                          "updated": {
                            "type": "string"
                          },
                          "tokenCount": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/catalog": {
      "get": {
        "operationId": "listGuides",
        "summary": "Every guide with all free fields. Bodies stripped. Free, no payment.",
        "responses": {
          "200": {
            "description": "Full catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "difficulty": {
                        "type": "string"
                      },
                      "readMins": {
                        "type": "integer"
                      },
                      "teaser": {
                        "type": "string"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "price": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Atomic USDC (6 dp). 10000 = $0.01. null = free."
                      },
                      "license": {
                        "type": "string"
                      },
                      "updated": {
                        "type": "string"
                      },
                      "tokenCount": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/kb": {
      "get": {
        "operationId": "getGuideBody",
        "summary": "Full guide body. Returns 402 unless paid (or the guide is free).",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "how-to-tell-if-a-cryptocurrency-is-legit",
                "installing-the-duino-coin-repo-on-linux-desktop",
                "repurposing-an-old-gpu-for-crypto-mining"
              ]
            }
          },
          {
            "name": "X-PAYMENT",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64 of an x402 PaymentPayload. Either {payload:{transaction}} with the chosen accepts entry as \"accepted\" (standard, facilitator-settled), or {payload:{session, reference}} after self-submitting a Solana transfer."
          }
        ],
        "responses": {
          "200": {
            "description": "The guide body. X-PAYMENT-RESPONSE carries the settlement receipt.",
            "headers": {
              "X-PAYMENT-RESPONSE": {
                "schema": {
                  "type": "string"
                },
                "description": "base64 SettlementResponse."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "t": {
                      "type": "string"
                    },
                    "c": {
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    },
                    "price": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "license": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 PaymentRequired object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "const": 2
                    },
                    "error": {
                      "type": "string"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "scheme": {
                            "type": "string",
                            "const": "exact"
                          },
                          "network": {
                            "type": "string",
                            "enum": [
                              "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
                              "solana",
                              "eip155:8453",
                              "base"
                            ]
                          },
                          "amount": {
                            "type": "string"
                          },
                          "asset": {
                            "type": "string"
                          },
                          "payTo": {
                            "type": "string"
                          },
                          "maxTimeoutSeconds": {
                            "type": "integer"
                          },
                          "extra": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown guide id."
          }
        }
      }
    },
    "/.well-known/x402.json": {
      "get": {
        "operationId": "getX402Manifest",
        "summary": "x402 discovery manifest — every resource, price, and payment requirement.",
        "responses": {
          "200": {
            "description": "Manifest.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-x402": {
    "version": 2,
    "manifest": "https://saylorinnovations.com/.well-known/x402.json",
    "networks": [
      "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "solana",
      "eip155:8453",
      "base"
    ],
    "payToByNetwork": {
      "solana": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "base": "0xf8A376eBF123D7252cd7b66bcD77A727a4def22f"
    },
    "pricePerGuideAtomic": "10000",
    "pricePerGuideUsd": 0.01
  }
}