x402 Text Summarizer
Compress long-form text to a target length and format using Claude AI. Supports plain text, Markdown, and JSON input. Part of the x402 micropayment task market.
Live service: https://project-summarizer-production.up.railway.app (pending deployment)
Payment: $0.005 USDC per call · x402 v2 · Base mainnet
What it does
Send text (or Markdown or a JSON payload) and get back a compressed summary in your chosen format — prose paragraph, bullet list, headline, or TL;DR. Specify a length preset (brief, medium, detailed) or an exact target word count.
Built for autonomous agents, document pipelines, and developers who need reliable, cheap, per-call text compression without managing prompt engineering or model selection themselves.
Supports two access modes:
- MCP tools via SSE — connect any MCP-compatible client directly, fiat billing via MCP-Hive
- REST + x402 — HTTP endpoint with USDC micropayment on Base mainnet ($0.005/call)
Endpoints
| Endpoint | Payment | Formats | Limit |
|---|---|---|---|
GET /sse (MCP SSE) | Fiat via MCP-Hive | All | None |
POST /v1/summarize | x402 USDC ($0.005) | All | 100KB input |
POST /v1/summarize/trial | Free | prose only | 4KB input |
GET /health | Free | — | — |
Quickstart — MCP (recommended for AI agents)
Add to your MCP client config:
{
"mcpServers": {
"summarizer": {
"url": "https://project-summarizer-production.up.railway.app/sse"
}
}
}
Two tools are available: summarize_text (full, all formats and lengths) and summarize_text_trial (free, prose only, 4KB limit).
Quickstart — trial (no payment)
curl -X POST https://project-summarizer-production.up.railway.app/v1/summarize/trial \
-H "Content-Type: application/json" \
-d '{
"input": "The Federal Reserve held interest rates steady on Wednesday, as expected by markets, while signaling it remains in no rush to cut borrowing costs amid continued uncertainty over trade policy and its effects on inflation. Fed Chair Jerome Powell said the central bank is watching the data carefully and is prepared to act if conditions change, but emphasized that patience is the appropriate stance for now. Markets had priced in two cuts by year-end before the meeting; that expectation held unchanged after the statement.",
"format": "prose",
"length": "brief"
}'
Response:
{
"summary": "The Federal Reserve kept rates unchanged and signaled patience on cuts, citing trade policy uncertainty and inflation risk. Markets expect two cuts by year-end.",
"format": "prose",
"word_count": 30,
"compression_ratio": 5.1,
"notes": null,
"meta": {
"format": "prose",
"length_preset": "brief",
"target_words": null,
"model": "claude-haiku-4-5",
"input_length": 612
}
}
Quickstart — paid endpoint (x402)
The paid endpoint requires an x402 v2 USDC micropayment of $0.005 per call on Base mainnet.
Payment flow:
- Send request to
POST /v1/summarizewithout payment headers. - Receive
402 Payment Requiredwithx402Version=2and payment details. - Sign and send payment via
PAYMENT-SIGNATUREheader. - Receive
200with summary result.
Request fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
input | string | yes | — | Text, Markdown, or JSON string to summarize |
input_type | string | no | "text" | "text", "markdown", or "json" |
format | string | no | "prose" | "prose", "bullets", "headline", or "tldr" |
length | string | no | "medium" | "brief", "medium", or "detailed" |
target_words | integer | no | null | Exact target word count (overrides length if set) |
explain | boolean | no | false | Include notes on what was omitted or compressed |
Format options
| Format | Description | Typical output |
|---|---|---|
prose | Single paragraph summary | 1–3 sentences / 30–150 words |
bullets | Bullet list of key points | 3–7 bullet items |
headline | One-sentence headline | ≤ 20 words |
tldr | TL;DR prefix + one sentence | ≤ 25 words |
Length presets
| Length | Target words (prose) | Behavior |
|---|---|---|
brief | ~30 words | Core conclusion only |
medium | ~80 words | Main points + key context |
detailed | ~200 words | Full summary preserving structure |
target_words overrides length when set.
Response fields
| Field | Type | Description |
|---|---|---|
summary | string | The compressed output in the requested format |
format | string | Format used (prose, bullets, headline, tldr) |
word_count | integer | Word count of the summary |
compression_ratio | float | Approximate input/output word ratio |
notes | string / null | What was omitted or compressed (only when explain=true) |
meta | object | Model, input length, and configuration metadata |
Pricing
| Mode | Price |
|---|---|
Trial (/v1/summarize/trial) | Free |
Paid (/v1/summarize) | $0.005 USDC per call |
Payment is handled via the x402 protocol — an HTTP-native micropayment standard using USDC on Base.
Health check
curl https://project-summarizer-production.up.railway.app/health
{"status": "ok", "service": "summarizer-agent", "version": "0.1.0"}
Ecosystem
This service is the fourth paid endpoint in the x402 micropayment task market:
- A2A Hub — service discovery
- Schema Checker — JSON Schema validation
- Formatter — data format conversion
- Classifier — content classification
- Summarizer (this service) — text compression
Full capability manifest: GET https://project-a2a-production.up.railway.app/v1/capabilities
Reporting issues
If you encounter unexpected responses, payment errors, or summarization quality issues, please open a GitHub issue.
Include:
- The endpoint called
- The request body (redact sensitive data)
- The response received
- The
X-Request-IDheader value from the response if available
服务器配置
{
"mcpServers": {
"x402-text-summarizer": {
"url": "https://web-production-78e17.up.railway.app/sse"
}
}
}