Skip to main content

llama-index-readers-skim

Give your LlamaIndex pipeline the ability to read any URL — clean Markdown, no ads, no nav, no boilerplate. Pays itself per call. No signup, no API key.

PyPI version License: MIT

llama-index-readers-skim is the official LlamaIndex reader for Skim — the canonical x402 clean reader API. It exposes one reader, SkimReader, that turns any web page into a LlamaIndex Document of agent-ready Markdown plus structured metadata (title, byline, published date, language, excerpt). Each call costs $0.002 in USDC on Base, paid automatically by your local wallet over HTTP 402.

See it before you wire it: try Skim free in your browser — 10 free skims a day, no wallet, no signup. Paste a URL, see exactly what your agent gets back.


Install

pip install llama-index-readers-skim

This pulls in the x402 client with EVM support, so there's nothing else to install.


Quickstart (60 seconds)

1. Fund a Base wallet with $1 of USDC

A dollar funds roughly 500 reads. Full step-by-step (with screenshots, for non-crypto-native devs): https://skim402.com/wallet.

Use a fresh wallet, not your personal one. This wallet's private key signs payment authorizations on your machine — treat it like a hot wallet for paying $0.002 tolls, not a savings account.

2. Point the reader at your wallet

export SKIM_WALLET_PRIVATE_KEY=0xYOUR_BASE_WALLET_PRIVATE_KEY

3. Use it

from llama_index.readers.skim import SkimReader

reader = SkimReader()  # reads SKIM_WALLET_PRIVATE_KEY from the environment

documents = reader.load_data(urls=["https://en.wikipedia.org/wiki/HTTP_402"])
print(documents[0].text)
print(documents[0].metadata)

The reader signs an EIP-3009 USDC authorization for $0.002, Skim returns clean Markdown, and you get back a Document with the article body as text and the page metadata in metadata. The payment shows up in your wallet's transaction history on BaseScan.


Build an index from web pages

SkimReader returns standard LlamaIndex Document objects, so it drops straight into any ingestion pipeline:

from llama_index.core import VectorStoreIndex
from llama_index.readers.skim import SkimReader

reader = SkimReader()
documents = reader.load_data(
    urls=[
        "https://example.com/article-one",
        "https://example.com/article-two",
    ]
)

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
print(query_engine.query("What do these articles have in common?"))

Each URL costs one $0.002 read, paid automatically as the documents load.


Output shape

load_data returns a list of Document objects. Each Document has:

  • text — the cleaned article body in Markdown.
  • metadata — a dict with the source URL plus the page metadata Skim extracted:
{
    "source": "https://example.com/article",
    "title": "Example article",
    "byline": "Jane Doe",
    "publishedAt": "2025-01-15",
    "lang": "en",
    "excerpt": "A short summary...",
}

Empty and None metadata values are dropped. Set include_metadata=False to keep only the source URL.


Configuration

SkimReader takes the following parameters (all optional except the wallet key):

Parameter Default Notes
private_key $SKIM_WALLET_PRIVATE_KEY Hex private key for the Base wallet that pays for reads. With or without 0x. Use a dedicated wallet — never your personal one.
base_url https://skim402.com Override the API base URL. For self-hosting or local development.
max_price_usd 0.01 Hard cap on per-call price in USD. The wallet refuses to sign for anything above this. Skim is $0.002/call.
include_metadata True Populate each Document's metadata with the page metadata Skim returns.
timeout 60 Per-request timeout in seconds.
reader = SkimReader(
    private_key="0x...",       # or rely on the env var
    max_price_usd=0.005,
    include_metadata=False,
)

How it actually works

your pipeline ──► SkimReader ──► POST https://skim402.com/api/v1/read
                     ▲                       │
                     │                       ▼
                     │              402 Payment Required
                     │                  (x402 challenge)
                     │                       │
                     ▼                       │
      x402 signs EIP-3009 USDC ◄─────────────┘
      transfer authorization (locally)
                     │
                     ▼
           retry POST with X-PAYMENT header
                     │
                     ▼
      Skim verifies + settles via Coinbase CDP facilitator
                     │
                     ▼
           200 OK + clean Markdown

Your private key never leaves your machine — it only signs authorizations locally.


Security

  • Dedicated wallet, always. Fund it with only as much USDC as you're willing to spend in a runaway loop. The max_price_usd cap catches accidental price escalations.
  • No outbound telemetry from this package. llama-index-readers-skim only talks to skim402.com (or whatever you set as base_url). No analytics, no error reporting, no phone-home.

Try it without a pipeline

Skeptical? Test the upstream endpoint directly — it'll return a 402 challenge so you can see the protocol in action:

curl -i -X POST https://skim402.com/api/v1/read \
  -H 'content-type: application/json' \
  -d '{"url":"https://en.wikipedia.org/wiki/HTTP_402"}'

You'll get back HTTP/1.1 402 Payment Required with the x402 challenge in the response body.


Links


License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_skim-0.1.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_skim-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_skim-0.1.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_skim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 38386e367b0e083bafc0feef7f50c9d521b7dc684813143b40aa50103cd8cf0c
MD5 0e22807ee6c3b7f7093e7ddfac9e7b9d
BLAKE2b-256 e6a351a57eb83a72390b7a1e1ff0942a957faa9c723ab1675fd9402053e7b820

See more details on using hashes here.

File details

Details for the file llama_index_readers_skim-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_skim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5950d6196bb8b4227dd9ebd7776a89538f1a4c83634c2ab7db314d9bfa4c169
MD5 b4689bce735d19f361bfc2cecc985744
BLAKE2b-256 31f28b85b58a1f83f7d6bcf7cfbc8484e033a4903278cb86b52da9b64a1c876f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page