{
  "serviceId": "pdf-tools",
  "displayName": "PDF Tools API",
  "description": "Inspect, check, split, merge, extract pages, rotate, linearize, optimize, strip metadata, encrypt, decrypt or repair PDFs from public HTTPS URLs. POST /v1/pdf with operation, input_urls and options. Answers JSON: document facts, and for transforms temporary HTTPS URLs to the result PDFs, kept one hour. Up to 50 MB per input. Pay per request in USDC; no account, no API key.",
  "category": "documents",
  "resourceUrl": "https://test.agent.pocket.network/v1/pdf-tools",
  "priceUsd": "0.005000",
  "priceVersion": 1,
  "rails": [
    {
      "id": "base",
      "network": "eip155:84532",
      "chainId": 84532,
      "tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
      "tokenDecimals": 6,
      "payToAddress": "0xF732ea490c5766071785a2310523f7fA2CEbB829"
    }
  ],
  "paymentNetworks": [
    "eip155:84532"
  ],
  "paymentProtocols": [
    "x402"
  ],
  "protocols": [
    "rest"
  ],
  "inputSchema": {
    "type": "object",
    "description": "The JSON body of POST /v1/pdf. Each operation's options schema is in the OpenAPI document the backend serves at /openapi.json. Limits: 50 MB per input, 100 MB in total, 500 combined pages.",
    "required": [
      "operation",
      "input_urls"
    ],
    "properties": {
      "operation": {
        "type": "string",
        "enum": [
          "inspect",
          "check",
          "split",
          "merge",
          "extract_pages",
          "rotate",
          "linearize",
          "optimize_structure",
          "remove_metadata",
          "encrypt",
          "decrypt",
          "repair"
        ],
        "description": "What to do with the PDF."
      },
      "input_urls": {
        "type": "array",
        "minItems": 1,
        "maxItems": 10,
        "examples": [
          [
            "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
          ]
        ],
        "items": {
          "type": "string",
          "maxLength": 2048,
          "pattern": "^https://"
        },
        "description": "Public HTTPS PDFs on port 443. merge takes 2 to 10; every other operation takes exactly one."
      },
      "options": {
        "type": "object",
        "description": "The operation's options. extract_pages needs {pages}; rotate needs {angle: 90, 180 or 270} and takes pages; split takes pages_per_file; encrypt needs owner_password and user_password (8 to 127 bytes, AES-256). Any operation takes password for an encrypted input; merge takes passwords, one per input."
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "description": "A JSON object with ok, service, operation, data, outputs and notes. data carries the document facts (page_count, pdf_version, encrypted, linearized, structurally_valid, ...); outputs lists each result PDF with url, bytes, page_count and expires_at. A refused request answers ok false with error.code and error.message, e.g. unsafe_url."
  },
  "methods": {
    "GET /": "read",
    "GET /v1/health": "read",
    "GET /v1/identity": "read",
    "GET /v1/version": "read",
    "POST /v1/pdf": "read",
    "POST /v1/self-test": "read"
  },
  "example": {
    "method": "POST",
    "path": "/v1/pdf",
    "request": {
      "operation": "inspect",
      "input_urls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
      ],
      "options": {}
    },
    "response": {
      "portal": {
        "provenance": "third-party-supplier",
        "serviceId": "pdf-tools",
        "schemaCheck": "unchecked"
      },
      "data": {
        "ok": true,
        "service": "pdf-tools",
        "operation": "inspect",
        "data": {
          "input_count": 1,
          "input_page_count": 1,
          "page_count": 1,
          "pdf_version": "1.4",
          "encrypted": false,
          "linearized": false,
          "has_forms": false,
          "has_bookmarks": true,
          "has_document_metadata": true,
          "page_rotations": [
            0
          ],
          "warning_count": 0
        },
        "outputs": [],
        "notes": []
      }
    },
    "capturedAt": "2026-10-15T12:13:00.708Z"
  },
  "firstParty": true,
  "networks": [
    "eip155:84532"
  ],
  "serving": true,
  "page": "https://test.agent.pocket.network/services/pdf-tools",
  "descriptor": "https://test.agent.pocket.network/services/pdf-tools/descriptor.json"
}