{
  "openapi": "3.1.0",
  "info": {
    "title": "Proofivy Library Server",
    "version": "1.0.0",
    "description": "Content fetch API. Pay per request via x402 and receive the article text together with its Proofivy content-id (CID), a cryptographic commitment to the exact bytes returned.",
    "x-guidance": "This API lets an agent fetch articles from publishers, and Apple device submitted content, paying per request via x402 on Base mainnet (eip155:8453). All payable routes return HTTP 402 with payment instructions on the first call; retry with the required payment header to receive content.\n\nTypical flow:\n1. Discover a content slug. For CryptoSlate articles, GET /cryptoslate_list returns every available slug with its last modified date. For The Phoblographer articles, GET /the_phoblographer_list does the same, and for TidBITS articles, GET /tidbits_list. For Proofivy posts, you must already know the slug or full URL. For Apple device content, you must already know the Proofivy CID.\n2. Fetch the content. POST /proofivy, /cryptoslate, /the_phoblographer, or /tidbits with {\"content_url\": \"<slug-or-url>\"}; or GET /apple_devices/{cid} for user submitted Apple device content.\n3. Every successful response carries {\"status\": \"success\", \"proofivy_cid\": \"bafkrei...\", \"text\": \"...\"}. The proofivy_cid is a CIDv1 over the returned text and can be independently verified.\n\nPricing: most routes are a flat 0.01 USD, settled in USDC on Base. POST /the_phoblographer is 0.07 USD and POST /tidbits is 0.03 USD. The /apple_devices/{cid} route uses per content pricing set by the original submitter and is therefore dynamic."
  },
  "paths": {
    "/proofivy": {
      "post": {
        "summary": "Look up a Proofivy post",
        "description": "Returns the text and Proofivy CID for a post on the Proofivy website. Provide either the canonical URL or the slug in content_url.",
        "operationId": "post_proofivy",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContentUrlRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Article content",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.01" },
          "network": "eip155:8453",
          "payTo": "0x38189D98110A395A1366F1c95875f81fD458a6C3"
        }
      }
    },
    "/cryptoslate": {
      "post": {
        "summary": "Look up a CryptoSlate article",
        "description": "Returns the text and Proofivy CID for a CryptoSlate article. Provide the article URL or slug in content_url. Use GET /cryptoslate_list to enumerate available slugs.",
        "operationId": "post_cryptoslate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContentUrlRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Article content",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.01" },
          "network": "eip155:8453",
          "payTo": "0x859af250DF0b68bfD0768cA22142a1AFa0aBEAF4"
        }
      }
    },
    "/cryptoslate_list": {
      "get": {
        "summary": "List available CryptoSlate articles",
        "description": "Returns every CryptoSlate slug currently in the corpus along with its last modified date. Useful for discovering what to fetch via POST /cryptoslate.",
        "operationId": "get_cryptoslate_list",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": { "type": "object", "properties": {} }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of available content URLs",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentListResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.01" },
          "network": "eip155:8453",
          "payTo": "0x859af250DF0b68bfD0768cA22142a1AFa0aBEAF4"
        }
      }
    },
    "/the_phoblographer": {
      "post": {
        "summary": "Look up a The Phoblographer article",
        "description": "Returns the text and Proofivy CID for a The Phoblographer article. Provide the article URL or slug in content_url. Use GET /the_phoblographer_list to enumerate available slugs.",
        "operationId": "post_the_phoblographer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContentUrlRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Article content",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.07" },
          "network": "eip155:8453",
          "payTo": "0xA0bDC6cD7EC19c9D4F0C72fB2D79fB65D118D3Ab"
        }
      }
    },
    "/the_phoblographer_list": {
      "get": {
        "summary": "List available The Phoblographer articles",
        "description": "Returns every The Phoblographer slug currently in the corpus along with its last modified date. Useful for discovering what to fetch via POST /the_phoblographer.",
        "operationId": "get_the_phoblographer_list",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": { "type": "object", "properties": {} }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of available content URLs",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentListResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.01" },
          "network": "eip155:8453",
          "payTo": "0xA0bDC6cD7EC19c9D4F0C72fB2D79fB65D118D3Ab"
        }
      }
    },
    "/tidbits": {
      "post": {
        "summary": "Look up a TidBITS article",
        "description": "Returns the text and Proofivy CID for a TidBITS article. Provide the article URL or slug in content_url. Use GET /tidbits_list to enumerate available slugs.",
        "operationId": "post_tidbits",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContentUrlRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Article content",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.03" },
          "network": "eip155:8453",
          "payTo": "0x01AdD9A04E36b75a1295b0A3d5a7a99cee6D2c36"
        }
      }
    },
    "/tidbits_list": {
      "get": {
        "summary": "List available TidBITS articles",
        "description": "Returns every TidBITS slug currently in the corpus along with its last modified date. Useful for discovering what to fetch via POST /tidbits.",
        "operationId": "get_tidbits_list",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": { "type": "object", "properties": {} }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of available content URLs",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentListResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.01" },
          "network": "eip155:8453",
          "payTo": "0x01AdD9A04E36b75a1295b0A3d5a7a99cee6D2c36"
        }
      }
    },
    "/apple_devices/{content_proofivy_cid}": {
      "get": {
        "summary": "Fetch user-submitted Apple-device content by CID",
        "description": "Returns content posted from an Apple device using the Proofivy app. The price is set by the original submitter and varies per CID; expect 402 with the live price on first call.",
        "operationId": "get_apple_devices",
        "parameters": [
          {
            "name": "content_proofivy_cid",
            "in": "path",
            "required": true,
            "description": "Proofivy CIDv1 of the content to fetch (e.g. starts with bafkrei...)",
            "schema": { "type": "string" }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": { "type": "object", "properties": {} }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User-submitted content",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContentResponse" }
              }
            }
          },
          "402": { "description": "Payment Required" }
        },
        "x-payment-info": {
          "protocols": [{ "x402": {} }],
          "price": { "mode": "dynamic", "currency": "USD", "min": "0.001", "max": "1000" },
          "network": "eip155:8453"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContentUrlRequest": {
        "type": "object",
        "required": ["content_url"],
        "properties": {
          "content_url": {
            "type": "string",
            "description": "Full URL or trailing slug of the article to retrieve (e.g. 'bitcoin-investment-thesis-...' or 'https://cryptoslate.com/bitcoin-investment-thesis-.../')"
          }
        }
      },
      "ContentResponse": {
        "type": "object",
        "required": ["status", "proofivy_cid", "text"],
        "properties": {
          "status": {
            "type": "string",
            "description": "'success' on a hit; otherwise an error description"
          },
          "proofivy_cid": {
            "type": "string",
            "description": "CIDv1 commitment to the returned text; empty string when status is an error"
          },
          "text": {
            "type": "string",
            "description": "The verified article body"
          }
        }
      },
      "ContentListResponse": {
        "type": "object",
        "required": ["status", "instructions", "content_urls"],
        "properties": {
          "status": { "type": "string" },
          "instructions": {
            "type": "string",
            "description": "Human/agent readable instructions on how to fetch an article from this list, including route, request body, payment and price"
          },
          "content_urls": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["slug", "date"],
              "properties": {
                "slug": { "type": "string", "description": "Slug to pass to POST /cryptoslate, POST /the_phoblographer or POST /tidbits as content_url" },
                "date": { "type": "string", "description": "Last-modified date in YYYY-MM-DD (UTC)" }
              }
            }
          }
        }
      }
    }
  }
}
