{"uid":"cap_EBL9cTIFaDPym0PMgK9VN","slug":"llm-token-compression-api-21553c4e","name":"LLM Token Compression API","description":"Token compression for LLMs","url":"https://agentic-endpoints-testnet.oliver-835.workers.dev/compress","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Text to compress"},"strategy":{"enum":["extractive","truncate"],"type":"string","description":"Compression strategy (default extractive)"},"target_tokens":{"type":"number","description":"Target token count"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Ln-8juCSkWFhgcpNmqRoJ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses text for LLMs using extractive or truncation strategies to reduce token count to a target","exampleAgentPrompt":"Compress this article text down to around 300 tokens using extractive compression so I can fit it into my LLM prompt: [paste article here].","exampleUseCases":[{"title":"Fitting long documents into context windows","prompt":"I have this 5,000-word research paper and I need to fit it into a 1,000-token context window — can you extractively compress it down to about 900 tokens?"},{"title":"Reducing RAG context before LLM call","prompt":"Before I send these retrieved documents to GPT-4, compress each chunk down to 200 tokens using extractive strategy so I stay within my budget."},{"title":"Truncating user input for cost control","prompt":"This user message is way too long — truncate it to 150 tokens so I can keep my API costs under control when I send it to Claude."}],"resultDescription":"Returns compressed text that preserves the most important content from the input, reduced to approximately the specified target token count using either extractive (key sentence selection) or truncation strategy.","failureModes":["Missing required 'text' parameter returns error","Invalid strategy value (not 'extractive' or 'truncate') causes validation failure","Target token count larger than input token count may return text unchanged","Very short input text with a high target token count may not reduce meaningfully","Payment failure or insufficient USDC balance blocks the call","Network timeout for very large text inputs"],"whenToPreferThis":"Choose this endpoint when you need deterministic, fast token reduction before calling an LLM and want a choice between extractive summarization (preserves key sentences) and simple truncation. Ideal for RAG pipelines, prompt pre-processing, and cost-control workflows where you must stay within a known context window limit.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:43:17.705Z","isFirstParty":false}