Agent integration

Add Skim to your agent in 30 seconds

Everything an agent needs to use Skim, on one page: the complete endpoint and price catalog, copy-paste tool definitions for every major framework, and how the x402 payment flow works. Start with POST https://skim402.com/api/v1/read for clean markdown ($0.002) — everything settles in USDC over x402, no API keys, no signup, no monthly bills.

The whole menu

Every endpoint and price

One wallet pays for everything below — same x402 flow on every endpoint, USDC on Base, no keys anywhere. Machine-readable versions: /llms.txt and the OpenAPI spec.

EndpointPriceWhat it does
GET /api/v2/read?url=$0.002Any page to clean markdown + metadata. Options: chunked=true (free RAG chunks), stripLinks, stripImages.
GET /api/v2/read/js?url=$0.005Same, with full JavaScript rendering for SPAs and script-heavy pages.
POST /api/v2/read/batch$0.020Up to 10 URLs in one paid call, read in parallel. Partial successes still return.
POST /api/v2/extract$0.015Typed JSON matching YOUR JSON Schema — values from the page, never invented.
GET /api/v2/extract/{preset}?url=$0.015Six ready-made schemas: article, product, job, review, event, table.
GET /api/v2/tables?url=$0.003Every HTML table on the page, parsed mechanically (no LLM) into records + markdown.
POST /api/v2/dataset$0.35Custom dataset build: your columns (up to 12 fields), your seed URLs, rows with per-row source citations. Polling is free; paginate with continueFrom until hasMore is false.
POST /api/v2/watch$0.01Register 1-20 URLs to watch. Returns a private watch id used to poll for changes.
GET /api/v2/watch/diff?id=$0.005What changed since your last check: per-URL added/removed line samples from the clean text, change ratio, and a numeric-only flag. Free status endpoint included.
GET /api/v2/feeds/x402/latest$0.005The x402 ecosystem feed: new paid services and price changes across public x402 registries.
GET /api/v2/signal/{name}/latest$0.005Fifteen vertical intelligence feeds — AI news, SEC filings, crypto, macro, security, regulations, courts, recalls, deals, launches, trending, research, energy, entertainment, campaign finance.

Free on top of any read: chunked=true returns RAG-ready chunks with heading breadcrumbs and token estimates. Dataset polling (GET /api/v2/dataset/:id) is always free. The legacy /api/v1/* paths still work at the same prices for v1-generation x402 clients.

Tool definition

OpenAI (Chat Completions / Assistants)

Drop this object into the tools array of any Chat Completions or Assistants API call. When the model decides to call it, hit POST https://skim402.com/api/v1/read with the arguments through an x402-aware fetch client.

{
  "type": "function",
  "function": {
    "name": "skim_read_url",
    "description": "Fetch any web page and return clean, readable Markdown plus structured metadata (title, author, byline, site name, published date). Use this whenever the user asks you to read, summarize, quote from, or analyze a URL. Strips ads, navigation, scripts, and tracking. Each call costs $0.002 in USDC and is paid automatically over x402.",
    "parameters": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "Absolute https URL of the page to read."
        }
      },
      "required": ["url"],
      "additionalProperties": false
    }
  }
}
Full Python example with x402 payment client
from openai import OpenAI
from x402 import x402ClientSync
from x402.client import max_amount
from x402.http.clients.requests import wrapRequestsWithPayment
from x402.mechanisms.evm.exact.register import register_exact_evm_client
from x402.mechanisms.evm.signers import EthAccountSigner
from eth_account import Account
import os, json, requests

client = OpenAI()
account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])
_pay = x402ClientSync()
register_exact_evm_client(_pay, EthAccountSigner(account), policies=[max_amount(10_000)])
skim = wrapRequestsWithPayment(requests.Session(), _pay)

TOOLS = [{
    "type": "function",
    "function": {
        "name": "skim_read_url",
        "description": "Fetch a URL and return clean Markdown plus metadata. $0.002 per call, paid in USDC over x402.",
        "parameters": {
            "type": "object",
            "properties": {"url": {"type": "string"}},
            "required": ["url"],
        },
    },
}]

def call_skim(url: str) -> dict:
    r = skim.post("https://skim402.com/api/v1/read", json={"url": url}, timeout=30)
    r.raise_for_status()
    return r.json()

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    tools=TOOLS,
    messages=[{"role": "user", "content": "Summarize https://example.com/article"}],
)

for call in resp.choices[0].message.tool_calls or []:
    if call.function.name == "skim_read_url":
        args = json.loads(call.function.arguments)
        result = call_skim(args["url"])
        print(result["markdown"][:500])
Tool definition

Anthropic Claude

Add this to the tools array of a messages.create call. Identical execution pattern: when Claude returns a tool_use block, call Skim with the supplied URL using an x402 client.

{
  "name": "skim_read_url",
  "description": "Fetch any web page and return clean, readable Markdown plus structured metadata (title, author, byline, site name, published date). Use this whenever the user asks you to read, summarize, quote from, or analyze a URL. Strips ads, navigation, scripts, and tracking. Each call costs $0.002 in USDC and is paid automatically over x402.",
  "input_schema": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "description": "Absolute https URL of the page to read."
      }
    },
    "required": ["url"]
  }
}
Function declaration

Google Gemini

Raw REST format (snake_case) for the generateContent endpoint. If you're using the JS SDK, rename function_declarations to functionDeclarations. Gemini's function calling uses uppercase type names.

{
  "function_declarations": [
    {
      "name": "skim_read_url",
      "description": "Fetch any web page and return clean, readable Markdown plus structured metadata. Strips ads, navigation, scripts, and trackers. Each call costs $0.002 in USDC, paid automatically over x402.",
      "parameters": {
        "type": "OBJECT",
        "properties": {
          "url": {
            "type": "STRING",
            "description": "Absolute https URL of the page to read."
          }
        },
        "required": ["url"]
      }
    }
  ]
}
TypeScript

Vercel AI SDK

Ready-to-use tool() with payment wired in via x402-fetch. Works with generateText, streamText, and agent loops.

import { tool } from "ai";
import { z } from "zod";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { wrapFetchWithPayment } from "x402-fetch";

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const wallet = createWalletClient({ account, transport: http(), chain: base });
const fetchWithPayment = wrapFetchWithPayment(fetch, wallet);

export const skimReadUrl = tool({
  description:
    "Fetch any web page and return clean Markdown plus metadata. " +
    "Strips ads, navigation, and trackers. " +
    "Costs $0.002 in USDC, paid automatically over x402.",
  parameters: z.object({
    url: z.string().url().describe("Absolute https URL of the page to read."),
  }),
  execute: async ({ url }) => {
    const res = await fetchWithPayment("https://skim402.com/api/v1/read", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ url }),
    });
    if (!res.ok) throw new Error(`Skim ${res.status}: ${await res.text()}`);
    return await res.json();
  },
});
Python

LangChain

A LangChain @tool-decorated function with x402 payment via the official Python SDK. Works with any LangChain agent — ReAct, OpenAI tools agent, LangGraph, etc.

from langchain_core.tools import tool
from x402 import x402ClientSync
from x402.client import max_amount
from x402.http.clients.requests import wrapRequestsWithPayment
from x402.mechanisms.evm.exact.register import register_exact_evm_client
from x402.mechanisms.evm.signers import EthAccountSigner
from eth_account import Account
import os, requests

account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])
_client = x402ClientSync()
register_exact_evm_client(_client, EthAccountSigner(account), policies=[max_amount(10_000)])
session = wrapRequestsWithPayment(requests.Session(), _client)

@tool
def skim_read_url(url: str) -> dict:
    """Fetch any web page and return clean Markdown plus structured metadata.

    Strips ads, navigation, scripts, and trackers. Costs $0.002 in USDC,
    paid automatically over x402. Use this whenever the user asks you to
    read, summarize, quote from, or analyze a URL.

    Args:
        url: Absolute https URL of the page to read.
    """
    r = session.post(
        "https://skim402.com/api/v1/read",
        json={"url": url},
        timeout=30,
    )
    r.raise_for_status()
    return r.json()
Python — MCP

OpenAI Agents SDK

The Agents SDK speaks MCP natively, and Skim ships an MCP server on npm (skim-mcp) — so instead of writing a tool you attach the server with MCPServerStdio and the agent gets the read_url tool, payment included. Works the same way in the JS SDK (@openai/agents) and in any other MCP client — Claude Desktop, Cursor, Cline.

# pip install openai-agents
# The Skim MCP server (npm: skim-mcp) exposes a read_url tool,
# with x402 payment handled inside the server.
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStdio

async def main():
    async with MCPServerStdio(
        params={
            "command": "npx",
            "args": ["-y", "skim-mcp"],
            "env": {"SKIM_WALLET_PRIVATE_KEY": "0x..."},
        },
    ) as skim:
        agent = Agent(
            name="Researcher",
            instructions="Use the Skim tools to read web pages.",
            mcp_servers=[skim],
        )
        result = await Runner.run(
            agent, "Summarize https://example.com/article"
        )
        print(result.final_output)

asyncio.run(main())

Set SKIM_WALLET_PRIVATE_KEY from your environment or secret store rather than inlining it — the server uses it locally to sign USDC authorizations and never transmits it.

HTTP

Raw HTTP / curl

No framework required. Any HTTP client that can handle a 402 response and replay with the X-PAYMENT header works.

# 1. First call — server replies 402 with x402 payment instructions
curl -i -X POST https://skim402.com/api/v1/read \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/article"}'

# 2. Sign the x402 challenge with your wallet, then retry with X-PAYMENT:
curl -X POST https://skim402.com/api/v1/read \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <base64-payment-payload>" \
  -d '{"url":"https://example.com/article"}'
What you get back

Response shape

Every successful call returns the same JSON shape. Hand markdown to your LLM for the cleanest results; use text for plain extraction and metadata for citations.

{
  "url": "https://example.com/article",
  "finalUrl": "https://example.com/article",
  "mode": "basic",
  "markdown": "# Article Title\n\nClean readable content...",
  "text": "Article Title\n\nClean readable content...",
  "metadata": {
    "title": "Article Title",
    "byline": "Jane Doe",
    "siteName": "Example",
    "publishedAt": "2026-01-15T10:00:00Z",
    "excerpt": "First paragraph or summary...",
    "lang": "en",
    "length": 4823
  },
  "structured": null,
  "fetchedAt": "2026-05-17T08:00:00Z"
}
Typed JSON

Also available: /v1/extract

Same agent, second tool. When you want typed JSON instead of markdown — populating a CRM, building a tracker, indexing for RAG — pass a URL plus a JSON Schema to https://skim402.com/api/v1/extract and the server returns JSON guaranteed to match. $0.015 per call in USDC. Extracted only from the cleaned page content, not the model's training data, so the JSON is verifiable against the source URL.

The OpenAI tool below works as-is. Same shape adapts trivially to Anthropic tools, Gemini function_declarations, Vercel AI SDK tool(), and LangChain @tool — see the full /v1/extract docs for the request/response contract.

{
  "type": "function",
  "function": {
    "name": "skim_extract_url",
    "description": "Fetch a URL and return typed JSON matching the provided JSON Schema. Skim cleans the page, then constrains an LLM to output values found on the page — never invented from training data. Use this when you need structured data from a web page (a company profile, an article's metadata, a product listing) instead of free-form markdown. Costs $0.015 in USDC, paid automatically over x402.",
    "parameters": {
      "type": "object",
      "properties": {
        "url":    { "type": "string", "description": "Absolute https URL to extract from." },
        "schema": { "type": "object", "description": "JSON Schema describing the desired output shape. Must have type: 'object' at the top level. Use 'description' on each property to hint the model." },
        "instructions": { "type": "string", "description": "Optional natural-language hint to bias extraction (the schema is the primary contract)." }
      },
      "required": ["url", "schema"],
      "additionalProperties": false
    }
  }
}
x402 in 60 seconds

How payment works

  1. Your agent calls POST /api/v1/read without any auth.
  2. Skim returns HTTP 402 Payment Required with a JSON body describing the price ($0.002 for /v1/read, $0.015 for /v1/extract), the receive address, and the chain (Base mainnet). Failed reads (4xx/5xx from the route handler) skip settlement — the wallet is not charged.
  3. Your x402 client (e.g. x402-fetch, x402-requests) signs an EIP-3009 transferWithAuthorization with the wallet private key, encodes it base64, and retries the same request with X-PAYMENT set.
  4. The Coinbase CDP facilitator verifies and settles the USDC transfer on-chain. Skim returns the clean markdown.

Your wallet needs a small USDC balance on Base mainnet. Top up once, spend across thousands of calls. Test against base-sepolia for free with the public facilitator first.

Ship it

No signup gate. Drop the tool in, point your wallet at Base, and your agent starts reading the web on its own dime.