POST
/api/smart-summarize$0.02📄 AI Smart Summarizer
Summarize any text or webpage using Claude Haiku with four specialized modes: bullet_points (key insights as bullets), executive (C-suite 3-5 sentence brief), technical (precise, metric-rich summary), and eli5 (simple explanation for a 10-year-old). Accepts raw text or a URL to fetch and summarize automatically.
Request Body
Response Fields
Code Examples
cURL
bash
# Summarize text
curl -X POST https://sparkforge.sh/api/smart-summarize \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-token>" \
-d '{
"text": "Your long article or document text...",
"type": "bullet_points"
}'
# Summarize a URL
curl -X POST https://sparkforge.sh/api/smart-summarize \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-token>" \
-d '{
"url": "https://en.wikipedia.org/wiki/Bitcoin",
"type": "executive"
}'Python
python
import requests
# Bullet-point summary of a URL
response = requests.post(
"https://sparkforge.sh/api/smart-summarize",
headers={"Content-Type": "application/json", "X-PAYMENT": "<token>"},
json={"url": "https://en.wikipedia.org/wiki/Ethereum", "type": "bullet_points"}
)
data = response.json()
print(data["summary"])
# → • Ethereum is a decentralized blockchain...
# → • Created by Vitalik Buterin in 2015...
# Technical summary of raw text
response2 = requests.post(
"https://sparkforge.sh/api/smart-summarize",
headers={"Content-Type": "application/json", "X-PAYMENT": "<token>"},
json={"text": long_doc, "type": "technical", "maxLength": 800}
)
print(response2.json()["summary"])TypeScript / Node.js
typescript
// Executive summary from URL
const res = await fetch402("https://sparkforge.sh/api/smart-summarize", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://en.wikipedia.org/wiki/Bitcoin",
type: "executive",
maxLength: 300,
}),
});
const { summary, type, inputLength, summaryLength } = await res.json();
console.log(`[${type}] ${summaryLength}/${inputLength} chars:`, summary);Example Response
json
{
"type": "bullet_points",
"summary": "• SparkForge is a pay-per-use API platform built on the x402 micropayment protocol\n• Developers access powerful tools including image generation, web scraping, and AI summarization\n• Payments are settled in USDC on Base, Polygon, or Solana\n• No API keys or subscriptions — pay only for what you use",
"inputLength": 980,
"summaryLength": 318,
"source": "text"
}💳 Payment via x402
This endpoint costs $0.02 per call, paid in USDC on Base, Polygon, or Solana. Use the @x402/fetch library to handle payments automatically, or implement the x402 handshake manually.
bash
# Free demo mode (no payment)
curl https://sparkforge.sh/api/smart-summarize?demo=true
# Or try via MCP (Claude Desktop, Cursor, Windsurf)
# Add to mcp config: { "url": "https://sparkforge.sh/api/mcp" }