{"uid":"cap_WhfHR6FZxJVnaeSQVfwEm","slug":"context-compression-api-e2f1983b","name":"Context Compression API","description":"Compress text using AI saliency scoring — reduces tokens while preserving meaning","url":"https://context-compression-api.johntaylor1online.workers.dev/compress","method":"POST","headers":{},"bodySchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","required":["input","output"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"body":{},"enum":["POST"],"type":"string","bodyType":"json"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_87f4PjJBrA-565045jYMo","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses text using AI saliency scoring to reduce token count while preserving semantic meaning","exampleAgentPrompt":"Compress this long document so it fits in a smaller context window — I need to reduce the token count but keep the most important information intact: [paste text here].","exampleUseCases":[{"title":"LLM prompt token budget trimming","prompt":"I need to send this 8,000-token research summary to GPT-4 but I only have a 2,000-token budget — can you compress it using AI saliency scoring to keep the most important parts?"},{"title":"Conversation history compression","prompt":"This chat history is getting too long for my AI assistant's context window. Compress it down to the key points so I can keep the conversation going without losing important context."},{"title":"RAG chunk size reduction","prompt":"I have these retrieved document chunks that are too large to fit into my retrieval-augmented generation pipeline — compress each one to reduce tokens while preserving the meaning so my LLM can process them."}],"resultDescription":"Returns a compressed version of the input text with reduced token count, where AI saliency scoring has identified and retained the most semantically important content while discarding lower-priority tokens.","failureModes":["Empty or missing input text returns a validation error","Text already below minimum length may not compress meaningfully","Payment failure via x402 protocol results in 402 Payment Required response","Very short inputs may return near-identical output with minimal compression","Rate limiting or worker timeout on extremely large inputs"],"whenToPreferThis":"Choose this endpoint when you need to reduce token count of text before sending it to an LLM, fitting content within a context window, or cutting API costs — especially when a simple truncation would lose important meaning and you want AI-guided saliency-based selection of what to keep.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:39:12.579Z","isFirstParty":false}