Metadata-Version: 2.5
Name: crewai-skim
Version: 0.1.3
Summary: CrewAI tool for Skim — clean web reader for AI agents. Card plan with API key (free tier) or x402 wallet pay-per-call ($0.002 USDC on Base).
Project-URL: Homepage, https://skim402.com
Project-URL: Documentation, https://skim402.com/docs
Project-URL: Repository, https://github.com/JessieJanie/skim402
Project-URL: x402 protocol, https://x402.org
Author-email: Skim <hello@skim402.com>
License: MIT
License-File: LICENSE
Keywords: agent,ai,crew-ai,crewai,llm,markdown,rag,reader,skim,web-scraping,x402
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: crewai>=0.70.0
Requires-Dist: eth-account>=0.13.0
Requires-Dist: requests>=2.31.0
Requires-Dist: x402[evm]>=2.0.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# crewai-skim

**Give your CrewAI agents the ability to read any URL — clean Markdown, ~4x smaller than raw HTML. No ads, no nav, no boilerplate.**

[![PyPI version](https://img.shields.io/pypi/v/crewai-skim.svg)](https://pypi.org/project/crewai-skim/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

`crewai-skim` is the official [CrewAI](https://www.crewai.com) tool for [Skim](https://skim402.com) — the clean reader API for AI agents. It exposes one tool, `SkimReader`, that any agent in your crew can call to fetch a web page as agent-ready Markdown plus structured metadata. Output is ~4x smaller than raw HTML — your agents spend fewer tokens and process pages faster.

**Two ways to pay:** card plan with API key (free tier: 1,000 reads/month — [skim402.com/pricing](https://skim402.com/pricing)) or x402 wallet pay-per-call ($0.002 USDC on Base, no account needed).

> **See it before you wire it:** [try Skim free in your browser](https://freeskims.skim402.com) — 10 free skims a day, no wallet, no signup. Paste a URL, see exactly what your agent gets back.

---

## Install

```bash
pip install crewai-skim
```

---

## Quickstart (60 seconds)

### 1. Get a free API key

Go to **[skim402.com/pricing](https://skim402.com/pricing)**, sign up for the free plan (1,000 reads/month), and copy your `sk402_...` key.

### 2. Set the env var

```bash
export SKIM_API_KEY=sk402_your_key_here
```

### 3. Use it

```python
from crewai_skim import SkimReader

reader = SkimReader()  # reads SKIM_API_KEY from the environment

markdown = reader.run(url="https://en.wikipedia.org/wiki/HTTP_402")
print(markdown)
```

---

## Alternative: pay per call with a crypto wallet

If you prefer x402 wallet pay-per-call instead of a card plan:

```bash
export SKIM_WALLET_PRIVATE_KEY=0xYOUR_BASE_WALLET_PRIVATE_KEY
```

Fund a dedicated Base wallet with a small USDC balance. Each read costs $0.002 on Base. Full setup guide: **<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.

---

## Use it in a crew

`SkimReader` is a standard CrewAI `BaseTool`, so it drops straight into any agent's tool list:

```python
from crewai import Agent, Task, Crew
from crewai_skim import SkimReader

researcher = Agent(
    role="Research Analyst",
    goal="Read and summarize web articles accurately",
    backstory="You turn messy web pages into clean, citable notes.",
    tools=[SkimReader()],
)

task = Task(
    description="Read https://en.wikipedia.org/wiki/HTTP_402 and summarize it in 5 bullet points.",
    expected_output="A 5-bullet summary.",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task])
print(crew.kickoff())
```

The agent decides when to call the Skim Web Reader, Skim returns clean Markdown (~4x smaller than raw HTML), and the model gets a faster, cheaper read.

---

## Output shape

`SkimReader` returns Markdown with a YAML frontmatter block of the page metadata:

```
---
title: Example article
byline: Jane Doe
publishedAt: 2025-01-15
lang: en
excerpt: A short summary...
---

# Example article

The cleaned article body in Markdown...
```

Set `include_metadata=False` to get just the Markdown body.

---

## Configuration

`SkimReader` takes the following parameters:

| Parameter          | Default                    | Notes                                                                                                                           |
| ------------------ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `api_key`          | `$SKIM_API_KEY`            | Card-plan API key (`sk402_...`). Get one free at skim402.com/pricing. Takes priority over `private_key`.                      |
| `private_key`      | `$SKIM_WALLET_PRIVATE_KEY` | Wallet lane only. Hex private key for the Base wallet. Ignored when `api_key` is set.                                         |
| `base_url`         | `https://skim402.com`      | Override the API base URL. For self-hosting or local development.                                                              |
| `max_price_usd`    | `0.01`                     | Wallet lane only. Hard cap on per-call price in USD. Skim is `$0.002`/call.                                                   |
| `include_metadata` | `True`                     | Prepend a YAML frontmatter block of page metadata to the returned Markdown.                                                    |
| `timeout`          | `60`                       | Per-request timeout in seconds.                                                                                                |

```python
# Card key (recommended)
reader = SkimReader(api_key="sk402_...")

# Or wallet
reader = SkimReader(
    private_key="0x...",
    max_price_usd=0.005,
    include_metadata=False,
)
```

---

## Security

- **No outbound telemetry from this package.** `crewai-skim` only talks to `skim402.com` (or whatever you set as `base_url`). No analytics, no error reporting, no phone-home.
- **Wallet lane:** the private key only signs payment authorizations locally — it never leaves your machine.

---

## Links

- **Skim website** — <https://skim402.com>
- **Pricing & free key** — <https://skim402.com/pricing>
- **Wallet setup guide** — <https://skim402.com/wallet>
- **API docs** — <https://skim402.com/docs>
- **GitHub** — <https://github.com/JessieJanie/skim402>

---

## License

MIT
