{
  "x402Version": 2,
  "lastUpdated": "2026-10-04T12:57:03.669Z",
  "name": "FetchWeb",
  "tagline": "Agent Context Optimizer",
  "description": "Pay-per-call web context services for AI agents: metadata probes, structured page extraction, and an Agent Context Optimizer that fits content to a token budget with an omission manifest. Use FetchWeb before sending web content to an LLM to cut prompt cost and stay inside the context window.",
  "category": "WEB_SEARCH_RESEARCH",
  "categories": [
    "WEB_SEARCH_RESEARCH",
    "DATA",
    "INFRASTRUCTURE"
  ],
  "tags": [
    "context-optimization",
    "token-budget",
    "web-extraction",
    "x402",
    "agent-context"
  ],
  "documentation": "https://fetchweb.net/api/public/openapi.json",
  "llmsTxt": "https://fetchweb.net/llms.txt",
  "provider": {
    "name": "FetchWeb",
    "url": "https://fetchweb.net"
  },
  "capabilities": {
    "javascriptRendering": false,
    "pdfExtraction": false,
    "contextBudgeting": true,
    "cachingSeconds": 900,
    "successOnlyBilling": true,
    "tokenCountsEstimated": true
  },
  "billing": {
    "modes": [
      "per-call",
      "prepaid"
    ],
    "successOnly": true,
    "perCall": {
      "description": "Sign an x402 X-PAYMENT header on every call. No account needed."
    },
    "prepaid": {
      "description": "Deposit USDC once, receive an API key, then send `Authorization: Bearer <key>` and each call draws its per-endpoint price from the balance — no on-chain settlement per request.",
      "topUp": "https://fetchweb.net/api/public/topup",
      "balance": "https://fetchweb.net/api/public/balance",
      "packs": [
        {
          "id": "1",
          "usd": 1,
          "atomic": 1000000,
          "calls": 500
        },
        {
          "id": "5",
          "usd": 5,
          "atomic": 5000000,
          "calls": 2500
        },
        {
          "id": "20",
          "usd": 20,
          "atomic": 20000000,
          "calls": 10000
        }
      ]
    },
    "pricing": "https://fetchweb.net/api/public/pricing",
    "health": "https://fetchweb.net/api/public/health"
  },
  "items": [
    {
      "resource": "https://fetchweb.net/api/public/metadata",
      "type": "http",
      "x402Version": 2,
      "lastUpdated": "2026-10-04T12:57:03.669Z",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "amount": "1000",
          "resource": "https://fetchweb.net/api/public/metadata",
          "description": "FetchWeb provides pay-per-call web metadata for AI agents. Use FetchWeb to quickly inspect a URL — title, description, canonical URL, language and estimated token size — before performing web extraction, web research or LLM processing, so an agent can judge whether a page is relevant.",
          "mimeType": "application/json",
          "payTo": "0x399676fbA6adb69634270b745E8097348cca6Af2",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        }
      ],
      "metadata": {
        "id": "metadata",
        "name": "Metadata probe",
        "provider": {
          "name": "FetchWeb",
          "url": "https://fetchweb.net"
        },
        "path": "/api/public/metadata",
        "method": "GET",
        "description": "FetchWeb provides pay-per-call web metadata for AI agents. Use FetchWeb to quickly inspect a URL — title, description, canonical URL, language and estimated token size — before performing web extraction, web research or LLM processing, so an agent can judge whether a page is relevant. When to use: Call this first when you have a candidate URL and want to decide, for a tenth of a cent, whether the page is relevant and how many tokens a full read would cost.",
        "whenToUse": "Call this first when you have a candidate URL and want to decide, for a tenth of a cent, whether the page is relevant and how many tokens a full read would cost.",
        "tags": [
          "web-extraction",
          "agent-context",
          "relevance-probe",
          "x402"
        ],
        "priceUsd": 0.001,
        "mimeType": "application/json",
        "input": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string",
              "description": "Public http(s) URL."
            }
          }
        },
        "output": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "canonicalUrl": {
              "type": "string"
            },
            "lang": {
              "type": [
                "string",
                "null"
              ]
            },
            "wordCount": {
              "type": "number"
            },
            "estimatedTokens": {
              "type": "number"
            },
            "charged": {
              "type": "boolean"
            }
          }
        },
        "example": {
          "request": {
            "url": "https://example.com/docs/api"
          },
          "response": {
            "title": "API reference",
            "description": "Endpoints, auth and rate limits.",
            "canonicalUrl": "https://example.com/docs/api",
            "lang": "en",
            "wordCount": 4820,
            "estimatedTokens": 6410,
            "charged": true
          }
        },
        "capabilities": {
          "javascriptRendering": false,
          "pdfExtraction": false,
          "contextBudgeting": true,
          "cachingSeconds": 900,
          "successOnlyBilling": true,
          "tokenCountsEstimated": true
        },
        "siwx": false,
        "supportsVanillax402": true,
        "supportsCircleGateway": false
      },
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET",
              "queryParams": {
                "url": "https://example.com/docs/api"
              }
            },
            "output": {
              "type": "json",
              "example": {
                "title": "API reference",
                "description": "Endpoints, auth and rate limits.",
                "canonicalUrl": "https://example.com/docs/api",
                "lang": "en",
                "wordCount": 4820,
                "estimatedTokens": 6410,
                "charged": true
              }
            }
          },
          "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",
                    "required": [
                      "url"
                    ],
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "Public http(s) URL."
                      }
                    }
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type",
                  "method"
                ]
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "canonicalUrl": {
                        "type": "string"
                      },
                      "lang": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "wordCount": {
                        "type": "number"
                      },
                      "estimatedTokens": {
                        "type": "number"
                      },
                      "charged": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      },
      "errors": [
        "invalid_url",
        "invalid_content",
        "access_denied",
        "not_found",
        "rate_limited",
        "upstream_error",
        "unsupported_content_type",
        "too_large",
        "timeout",
        "fetch_failed",
        "insufficient_balance"
      ],
      "cache": {
        "ttlSeconds": 900,
        "freeOnHit": false
      }
    },
    {
      "resource": "https://fetchweb.net/api/public/extract",
      "type": "http",
      "x402Version": 2,
      "lastUpdated": "2026-10-04T12:57:03.669Z",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "amount": "2000",
          "resource": "https://fetchweb.net/api/public/extract",
          "description": "FetchWeb provides pay-per-call webpage content extraction for AI agents. Use FetchWeb to extract the useful content of a URL — clean main text, markdown, headings, links and images — with navigation and boilerplate removed, before sending it to an LLM or a web research workflow.",
          "mimeType": "application/json",
          "payTo": "0x399676fbA6adb69634270b745E8097348cca6Af2",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        }
      ],
      "metadata": {
        "id": "extract",
        "name": "Extract",
        "provider": {
          "name": "FetchWeb",
          "url": "https://fetchweb.net"
        },
        "path": "/api/public/extract",
        "method": "POST",
        "description": "FetchWeb provides pay-per-call webpage content extraction for AI agents. Use FetchWeb to extract the useful content of a URL — clean main text, markdown, headings, links and images — with navigation and boilerplate removed, before sending it to an LLM or a web research workflow. When to use: Call this when you need the full clean content of a page (no navs, ads or footers) as text, markdown or structured JSON before reasoning over it.",
        "whenToUse": "Call this when you need the full clean content of a page (no navs, ads or footers) as text, markdown or structured JSON before reasoning over it.",
        "tags": [
          "web-extraction",
          "agent-context",
          "markdown",
          "x402"
        ],
        "priceUsd": 0.002,
        "mimeType": "application/json",
        "input": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string"
            },
            "format": {
              "type": "string",
              "enum": [
                "json",
                "text",
                "markdown"
              ],
              "default": "json"
            }
          }
        },
        "output": {
          "type": "object",
          "properties": {
            "url": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "text": {
              "type": "string"
            },
            "markdown": {
              "type": "string"
            },
            "headings": {
              "type": "array"
            },
            "links": {
              "type": "array"
            },
            "images": {
              "type": "array"
            }
          }
        },
        "example": {
          "request": {
            "url": "https://example.com/docs/api",
            "format": "markdown"
          },
          "response": {
            "url": "https://example.com/docs/api",
            "title": "API reference",
            "markdown": "# API reference\n\n## Authentication\n...",
            "headings": [
              {
                "level": 2,
                "text": "Authentication"
              }
            ],
            "charged": true
          }
        },
        "capabilities": {
          "javascriptRendering": false,
          "pdfExtraction": false,
          "contextBudgeting": true,
          "cachingSeconds": 900,
          "successOnlyBilling": true,
          "tokenCountsEstimated": true
        },
        "siwx": false,
        "supportsVanillax402": true,
        "supportsCircleGateway": false
      },
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "body": {
                "url": "https://example.com/docs/api",
                "format": "markdown"
              }
            },
            "output": {
              "type": "json",
              "example": {
                "url": "https://example.com/docs/api",
                "title": "API reference",
                "markdown": "# API reference\n\n## Authentication\n...",
                "headings": [
                  {
                    "level": 2,
                    "text": "Authentication"
                  }
                ],
                "charged": true
              }
            }
          },
          "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": [
                      "POST"
                    ]
                  },
                  "bodyType": {
                    "type": "string",
                    "const": "json"
                  },
                  "body": {
                    "type": "object",
                    "required": [
                      "url"
                    ],
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "json",
                          "text",
                          "markdown"
                        ],
                        "default": "json"
                      }
                    }
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type",
                  "method"
                ]
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "markdown": {
                        "type": "string"
                      },
                      "headings": {
                        "type": "array"
                      },
                      "links": {
                        "type": "array"
                      },
                      "images": {
                        "type": "array"
                      }
                    }
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      },
      "errors": [
        "invalid_url",
        "invalid_content",
        "access_denied",
        "not_found",
        "rate_limited",
        "upstream_error",
        "unsupported_content_type",
        "too_large",
        "timeout",
        "fetch_failed",
        "insufficient_balance"
      ],
      "cache": {
        "ttlSeconds": 900,
        "freeOnHit": false
      }
    },
    {
      "resource": "https://fetchweb.net/api/public/optimize",
      "type": "http",
      "x402Version": 2,
      "lastUpdated": "2026-10-04T12:57:03.669Z",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "amount": "1500",
          "resource": "https://fetchweb.net/api/public/optimize",
          "description": "FetchWeb provides pay-per-call AI context optimization for web content. Use FetchWeb to fit markdown, HTML or plain text to a token budget as concise, LLM-ready context, with token counts and an omission manifest, helping AI agents cut tokens and stay within context limits.",
          "mimeType": "application/json",
          "payTo": "0x399676fbA6adb69634270b745E8097348cca6Af2",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        }
      ],
      "metadata": {
        "id": "optimize",
        "name": "Context optimize",
        "provider": {
          "name": "FetchWeb",
          "url": "https://fetchweb.net"
        },
        "path": "/api/public/optimize",
        "method": "POST",
        "description": "FetchWeb provides pay-per-call AI context optimization for web content. Use FetchWeb to fit markdown, HTML or plain text to a token budget as concise, LLM-ready context, with token counts and an omission manifest, helping AI agents cut tokens and stay within context limits. When to use: Call this when you already hold content (markdown, HTML or text) that is larger than the context you can afford, and you need it fitted to a token budget with an audit trail of what was dropped.",
        "whenToUse": "Call this when you already hold content (markdown, HTML or text) that is larger than the context you can afford, and you need it fitted to a token budget with an audit trail of what was dropped.",
        "tags": [
          "context-optimization",
          "token-budget",
          "agent-context",
          "x402"
        ],
        "priceUsd": 0.0015,
        "mimeType": "application/json",
        "input": {
          "type": "object",
          "required": [
            "content"
          ],
          "properties": {
            "content": {
              "type": "string",
              "description": "Markdown, HTML or plain text to compress."
            },
            "max_tokens": {
              "type": "number",
              "default": 2000
            },
            "query": {
              "type": "string",
              "description": "Optional task/query to bias relevance."
            },
            "input_format": {
              "type": "string",
              "enum": [
                "auto",
                "markdown",
                "html",
                "text"
              ],
              "default": "auto"
            },
            "preserve_links": {
              "type": "boolean",
              "default": true
            },
            "preserve_tables": {
              "type": "boolean",
              "default": true
            },
            "preserve_code": {
              "type": "boolean",
              "default": true
            }
          }
        },
        "output": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string"
            },
            "charged": {
              "type": "boolean"
            },
            "report": {
              "type": "object",
              "properties": {
                "tokensIn": {
                  "type": "number"
                },
                "tokensOut": {
                  "type": "number"
                },
                "tokensSaved": {
                  "type": "number"
                },
                "reductionPercent": {
                  "type": "number"
                },
                "budgetTokens": {
                  "type": "number"
                },
                "estimated": {
                  "type": "boolean"
                }
              }
            },
            "omissions": {
              "type": "array"
            },
            "outline": {
              "type": "array"
            }
          }
        },
        "example": {
          "request": {
            "content": "# Long page\n\n...",
            "max_tokens": 2000,
            "query": "rate limits"
          },
          "response": {
            "content": "## Rate limits\n\n...",
            "report": {
              "tokensIn": 18430,
              "tokensOut": 1974,
              "tokensSaved": 16456,
              "reductionPercent": 89,
              "budgetTokens": 2000,
              "estimated": true
            },
            "omissions": [
              {
                "section": "Changelog",
                "reason": "low_value",
                "tokensRemoved": 4120
              }
            ],
            "charged": true
          }
        },
        "capabilities": {
          "javascriptRendering": false,
          "pdfExtraction": false,
          "contextBudgeting": true,
          "cachingSeconds": 900,
          "successOnlyBilling": true,
          "tokenCountsEstimated": true
        },
        "siwx": false,
        "supportsVanillax402": true,
        "supportsCircleGateway": false
      },
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "body": {
                "content": "# Long page\n\n...",
                "max_tokens": 2000,
                "query": "rate limits"
              }
            },
            "output": {
              "type": "json",
              "example": {
                "content": "## Rate limits\n\n...",
                "report": {
                  "tokensIn": 18430,
                  "tokensOut": 1974,
                  "tokensSaved": 16456,
                  "reductionPercent": 89,
                  "budgetTokens": 2000,
                  "estimated": true
                },
                "omissions": [
                  {
                    "section": "Changelog",
                    "reason": "low_value",
                    "tokensRemoved": 4120
                  }
                ],
                "charged": true
              }
            }
          },
          "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": [
                      "POST"
                    ]
                  },
                  "bodyType": {
                    "type": "string",
                    "const": "json"
                  },
                  "body": {
                    "type": "object",
                    "required": [
                      "content"
                    ],
                    "properties": {
                      "content": {
                        "type": "string",
                        "description": "Markdown, HTML or plain text to compress."
                      },
                      "max_tokens": {
                        "type": "number",
                        "default": 2000
                      },
                      "query": {
                        "type": "string",
                        "description": "Optional task/query to bias relevance."
                      },
                      "input_format": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "markdown",
                          "html",
                          "text"
                        ],
                        "default": "auto"
                      },
                      "preserve_links": {
                        "type": "boolean",
                        "default": true
                      },
                      "preserve_tables": {
                        "type": "boolean",
                        "default": true
                      },
                      "preserve_code": {
                        "type": "boolean",
                        "default": true
                      }
                    }
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type",
                  "method"
                ]
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "type": "string"
                      },
                      "charged": {
                        "type": "boolean"
                      },
                      "report": {
                        "type": "object",
                        "properties": {
                          "tokensIn": {
                            "type": "number"
                          },
                          "tokensOut": {
                            "type": "number"
                          },
                          "tokensSaved": {
                            "type": "number"
                          },
                          "reductionPercent": {
                            "type": "number"
                          },
                          "budgetTokens": {
                            "type": "number"
                          },
                          "estimated": {
                            "type": "boolean"
                          }
                        }
                      },
                      "omissions": {
                        "type": "array"
                      },
                      "outline": {
                        "type": "array"
                      }
                    }
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      },
      "errors": [
        "invalid_url",
        "invalid_content",
        "access_denied",
        "not_found",
        "rate_limited",
        "upstream_error",
        "unsupported_content_type",
        "too_large",
        "timeout",
        "fetch_failed",
        "insufficient_balance"
      ],
      "cache": {
        "ttlSeconds": 900,
        "freeOnHit": false
      }
    },
    {
      "resource": "https://fetchweb.net/api/public/extract-and-optimize",
      "type": "http",
      "x402Version": 2,
      "lastUpdated": "2026-10-04T12:57:03.669Z",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "amount": "4000",
          "resource": "https://fetchweb.net/api/public/extract-and-optimize",
          "description": "FetchWeb provides pay-per-call web extraction and AI context optimization in one operation. Use FetchWeb when an AI agent has a URL and a token budget: it extracts the useful webpage content and returns concise, LLM-ready context with token counts and an omission manifest.",
          "mimeType": "application/json",
          "payTo": "0x399676fbA6adb69634270b745E8097348cca6Af2",
          "extra": {
            "name": "USD Coin",
            "version": "2"
          }
        }
      ],
      "metadata": {
        "id": "extract-and-optimize",
        "name": "Extract + optimize",
        "provider": {
          "name": "FetchWeb",
          "url": "https://fetchweb.net"
        },
        "path": "/api/public/extract-and-optimize",
        "method": "POST",
        "description": "FetchWeb provides pay-per-call web extraction and AI context optimization in one operation. Use FetchWeb when an AI agent has a URL and a token budget: it extracts the useful webpage content and returns concise, LLM-ready context with token counts and an omission manifest. When to use: Call this when you only have a URL and a token budget: one call fetches the page and returns context already fitted to max_tokens, query-aware if you pass a query.",
        "whenToUse": "Call this when you only have a URL and a token budget: one call fetches the page and returns context already fitted to max_tokens, query-aware if you pass a query.",
        "tags": [
          "context-optimization",
          "token-budget",
          "web-extraction",
          "agent-context",
          "x402"
        ],
        "priceUsd": 0.004,
        "mimeType": "application/json",
        "input": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string"
            },
            "max_tokens": {
              "type": "number",
              "default": 2000
            },
            "query": {
              "type": "string"
            },
            "preserve_links": {
              "type": "boolean",
              "default": true
            },
            "preserve_tables": {
              "type": "boolean",
              "default": true
            },
            "preserve_code": {
              "type": "boolean",
              "default": true
            }
          }
        },
        "output": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string"
            },
            "charged": {
              "type": "boolean"
            },
            "report": {
              "type": "object",
              "properties": {
                "tokensIn": {
                  "type": "number"
                },
                "tokensOut": {
                  "type": "number"
                },
                "tokensSaved": {
                  "type": "number"
                },
                "reductionPercent": {
                  "type": "number"
                },
                "budgetTokens": {
                  "type": "number"
                },
                "estimated": {
                  "type": "boolean"
                }
              }
            },
            "omissions": {
              "type": "array"
            },
            "outline": {
              "type": "array"
            }
          }
        },
        "example": {
          "request": {
            "url": "https://example.com/docs/api",
            "max_tokens": 2000,
            "query": "rate limits"
          },
          "response": {
            "content": "## Rate limits\n\n...",
            "report": {
              "tokensIn": 18430,
              "tokensOut": 1974,
              "reductionPercent": 89,
              "budgetTokens": 2000
            },
            "omissions": [
              {
                "section": "Newsletter",
                "reason": "boilerplate",
                "tokensRemoved": 210
              }
            ],
            "charged": true
          }
        },
        "capabilities": {
          "javascriptRendering": false,
          "pdfExtraction": false,
          "contextBudgeting": true,
          "cachingSeconds": 900,
          "successOnlyBilling": true,
          "tokenCountsEstimated": true
        },
        "siwx": false,
        "supportsVanillax402": true,
        "supportsCircleGateway": false
      },
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "body": {
                "url": "https://example.com/docs/api",
                "max_tokens": 2000,
                "query": "rate limits"
              }
            },
            "output": {
              "type": "json",
              "example": {
                "content": "## Rate limits\n\n...",
                "report": {
                  "tokensIn": 18430,
                  "tokensOut": 1974,
                  "reductionPercent": 89,
                  "budgetTokens": 2000
                },
                "omissions": [
                  {
                    "section": "Newsletter",
                    "reason": "boilerplate",
                    "tokensRemoved": 210
                  }
                ],
                "charged": true
              }
            }
          },
          "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": [
                      "POST"
                    ]
                  },
                  "bodyType": {
                    "type": "string",
                    "const": "json"
                  },
                  "body": {
                    "type": "object",
                    "required": [
                      "url"
                    ],
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "max_tokens": {
                        "type": "number",
                        "default": 2000
                      },
                      "query": {
                        "type": "string"
                      },
                      "preserve_links": {
                        "type": "boolean",
                        "default": true
                      },
                      "preserve_tables": {
                        "type": "boolean",
                        "default": true
                      },
                      "preserve_code": {
                        "type": "boolean",
                        "default": true
                      }
                    }
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "type",
                  "method"
                ]
              },
              "output": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "example": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "type": "string"
                      },
                      "charged": {
                        "type": "boolean"
                      },
                      "report": {
                        "type": "object",
                        "properties": {
                          "tokensIn": {
                            "type": "number"
                          },
                          "tokensOut": {
                            "type": "number"
                          },
                          "tokensSaved": {
                            "type": "number"
                          },
                          "reductionPercent": {
                            "type": "number"
                          },
                          "budgetTokens": {
                            "type": "number"
                          },
                          "estimated": {
                            "type": "boolean"
                          }
                        }
                      },
                      "omissions": {
                        "type": "array"
                      },
                      "outline": {
                        "type": "array"
                      }
                    }
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "required": [
              "input"
            ]
          }
        }
      },
      "errors": [
        "invalid_url",
        "invalid_content",
        "access_denied",
        "not_found",
        "rate_limited",
        "upstream_error",
        "unsupported_content_type",
        "too_large",
        "timeout",
        "fetch_failed",
        "insufficient_balance"
      ],
      "cache": {
        "ttlSeconds": 900,
        "freeOnHit": false
      }
    }
  ]
}