{
  "x402Version": 2,
  "service": "Open Books",
  "description": "otl Library book search, commercial-license screening, metadata and text/EPUB access for AI agents.",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0xA5E6eB31868A85127B1ED82b8C760193356206ED"
    },
    {
      "scheme": "exact",
      "network": "eip155:42161",
      "asset": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "payTo": "0xA5E6eB31868A85127B1ED82b8C760193356206ED"
    }
  ],
  "offers": [
    {
      "id": "search",
      "price_usd": 0.002,
      "endpoint": "/v1/search"
    },
    {
      "id": "book",
      "price_usd": 0.001,
      "endpoint": "/v1/book/otl/{id}"
    },
    {
      "id": "read",
      "price_usd": 0.005,
      "endpoint": "/v1/read/otl/{id}"
    },
    {
      "id": "bulk",
      "price_usd": 0.004,
      "endpoint": "/v1/bulk"
    },
    {
      "id": "enrich",
      "price_usd": 0.02,
      "endpoint": "/v1/enrich"
    },
    {
      "id": "preview",
      "price_usd": 0,
      "endpoint": "/v1/preview"
    },
    {
      "id": "full",
      "price_usd": "chunks x 0.005",
      "endpoint": "/v1/full/otl/{id}"
    },
    {
      "id": "corpus_bundle",
      "price_usd": "chunks x 0.005 (delivered bytes)",
      "endpoint": "/v1/corpus/bundle"
    },
    {
      "id": "corpus_quote",
      "price_usd": 0,
      "endpoint": "/v1/corpus/quote"
    },
    {
      "id": "session_15m",
      "price_usd": 0.5,
      "endpoint": "/v1/session"
    },
    {
      "id": "session_30m",
      "price_usd": 0.9,
      "endpoint": "/v1/session"
    },
    {
      "id": "session_60m",
      "price_usd": 1.8,
      "endpoint": "/v1/session"
    }
  ],
  "note": "Los precios y la wallet son los ya configurados en el Worker; este manifiesto solo los expone.",
  "version": 2,
  "name": "Open Books",
  "resources": [
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/search",
      "type": "http",
      "method": "GET",
      "description": "Search otl Library books.",
      "price_usd": "0.002",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET",
              "queryParams": {
                "q": "computer science",
                "provider": "otl",
                "limit": 3
              }
            },
            "output": {
              "type": "json",
              "example": {
                "provider": "otl",
                "results": []
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  },
                  "queryParams": {
                    "type": "object",
                    "properties": {
                      "q": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string",
                        "enum": [
                          "all",
                          "otl"
                        ]
                      },
                      "limit": {
                        "type": "integer",
                        "maximum": 20
                      }
                    },
                    "required": [
                      "q"
                    ]
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    },
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/book/otl/{id}",
      "type": "http",
      "method": "GET",
      "description": "otl Library metadata, original file formats and item-level commercial-use license.",
      "price_usd": "0.001",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET"
            },
            "output": {
              "type": "json",
              "example": {
                "rights_verified": false
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    },
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/read/otl/{id}",
      "type": "http",
      "method": "GET",
      "description": "Original PDF/EPUB/text file chunk; bytes unchanged.",
      "price_usd": "0.005",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET",
              "queryParams": {
                "chunk": 0
              }
            },
            "output": {
              "type": "json",
              "example": {
                "content_type": "application/octet-stream",
                "raw_bytes": "original file bytes"
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  },
                  "queryParams": {
                    "type": "object",
                    "properties": {
                      "chunk": {
                        "type": "integer"
                      }
                    },
                    "required": []
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    },
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/full/otl/{id}",
      "type": "http",
      "method": "GET",
      "description": "Complete original PDF/EPUB/text file; bytes unchanged.",
      "price_usd": "chunks x 0.005",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET"
            },
            "output": {
              "type": "json",
              "example": {
                "content_type": "application/octet-stream",
                "stream": "original file bytes"
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    },
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/epub/{id}",
      "type": "http",
      "method": "GET",
      "description": "Original EPUB under verified commercial-use license; preserve attribution and license terms.",
      "price_usd": "chunks x 0.005",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET"
            },
            "output": {
              "type": "json",
              "example": {
                "content_type": "application/epub+zip"
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    },
    {
      "resource": "https://open-books.alfrexo95.workers.dev/v1/agent/kit",
      "type": "http",
      "method": "GET",
      "description": "x402 paid agent integration kits: starter 0.002, builder 0.01, pro 0.05 USDC.",
      "price_usd": "0.002-0.05 by tier",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET",
              "queryParams": {
                "tier": "starter"
              }
            },
            "output": {
              "type": "json",
              "example": {
                "product": "agent_integration_kit"
              }
            }
          },
          "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "input": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "http"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "GET"
                    ]
                  },
                  "queryParams": {
                    "type": "object",
                    "properties": {
                      "tier": {
                        "type": "string",
                        "enum": [
                          "starter",
                          "builder",
                          "pro"
                        ]
                      }
                    },
                    "required": [
                      "tier"
                    ]
                  }
                },
                "required": [
                  "type",
                  "method"
                ],
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object"
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      }
    }
  ],
  "discovery": {
    "openapi": "https://open-books.alfrexo95.workers.dev/openapi.json",
    "llms_txt": "https://open-books.alfrexo95.workers.dev/llms.txt",
    "agent_card": "https://open-books.alfrexo95.workers.dev/.well-known/agent-card.json",
    "mcp": "https://open-books.alfrexo95.workers.dev/mcp"
  }
}