Summarize API: extractive text summarization for agents
Summarizes long text into a concise extractive summary using word-frequency sentence scoring, for $0.01 USDC per call through x402 on Base. No signup, no API key.
Endpoint
POST https://apisphere.us.ci/api/v1/summarize returns the top sentences from the input text, scored by word frequency. A plain GET only advertises the x402 payment challenge - send text over POST.
- Price: $0.01 USDC per call, settled on Base through x402.
- Max text length: 50,000 characters.
- Default: returns 5 top sentences; configurable via max_sentences.
Request fields
Send a JSON body. Invalid bodies return 400 with field-level details.
- text (required): 1 to 50,000 characters - the text to summarize.
- max_sentences (optional): integer from 1 to 20, defaults to 5.
curl -X POST https://apisphere.us.ci/api/v1/summarize -H "Content-Type: application/json" -H "X-PAYMENT: <signed-payment-payload>" -d '{"text": "Long article text here...", "max_sentences": 3}'Response
A 200 response returns the summary sentences, original and summary lengths, compression ratio, and the total sentence count, plus a meta block with the request id and latency.
- 400 - invalid text or max_sentences (details in the response).
- 402 - missing or invalid payment.
- 429 - rate limited; honor Retry-After.
- 500 - internal error; every response carries X-Request-Id for support.
{
"summary": [
"Indonesia is an archipelago nation in Southeast Asia.",
"It is the world's largest island country, with over 17,000 islands."
],
"original_length": 320,
"summary_length": 118,
"compression_ratio": "63%",
"sentence_count": 5,
"meta": {
"cache": "miss",
"request_id": "7f3a9c2e-1b4d-4f6a-8c2e-9d1f5a3b7c4e",
"latency_ms": 12
}
}