{"uid":"cap_ISxEhN-mwm8ESKviS-Jdn","slug":"strale-prompt-compress-9df7408b","name":"Strale Prompt Compress","description":"The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.","url":"https://api.strale.io/x402/v2/prompt-compress","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["prompt_text"],"properties":{"prompt_text":{"type":"string"},"target_reduction_percent":{"type":"integer","description":"Default 30"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0324","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.0324/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dV7E6-MavIaVDsS9sBd7y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0324","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses a prompt text by a target percentage to reduce token usage while preserving meaning","exampleAgentPrompt":"Can you compress this prompt text by 30% to reduce my token usage: 'You are a helpful assistant. Your job is to answer questions accurately and concisely. When the user asks something, you should think carefully before responding and make sure your answer is well-reasoned and grounded in facts.'","exampleUseCases":[{"title":"Reduce LLM API costs at scale","prompt":"I'm sending thousands of requests to GPT-4 and costs are piling up — can you compress this system prompt by 40% so I reduce token usage on every call? Here it is: 'You are a customer support agent for a SaaS company. Be professional, empathetic, and concise. Always ask clarifying questions before proposing a solution. Escalate to a human if the issue is billing-related.'"},{"title":"Fit prompt into context window","prompt":"This prompt is too long for the model's context window — can you shorten it by 30% while keeping the meaning intact: 'You are an advanced research assistant specializing in biomedical literature. Summarize papers, extract key findings, identify methodology flaws, and flag contradictory evidence across sources. Prioritize peer-reviewed journals and note confidence levels.'"},{"title":"Optimize few-shot prompt examples","prompt":"I have a few-shot prompt that's eating up a lot of tokens — please compress it by 35%: 'Given a customer complaint, classify it as Billing, Technical, or General. Example 1: Customer says invoice is wrong — Billing. Example 2: App crashes on login — Technical. Example 3: Asking about office hours — General. Now classify the following complaint:'"}],"resultDescription":"Returns a compressed version of the input prompt text with reduced character/token count at approximately the requested reduction percentage, preserving semantic meaning and key instructions. The response includes an audit record with cryptographic chain hashing per Strale's trust layer standard.","failureModes":["Missing required prompt_text parameter returns a 400 validation error","target_reduction_percent outside a valid range may return an error or be clamped to defaults","Very short input prompts may not compress meaningfully or return unchanged text","Prompt content that is already highly compressed may yield less than the target reduction","Payment failure or insufficient USDC balance returns a 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need to reduce token consumption of LLM prompts at inference time, especially in high-volume or cost-sensitive pipelines. It is preferable to manual summarization when you want deterministic compression with a target percentage and an auditable, cryptographically-hashed record of the transformation. Particularly useful for agents that repeatedly send long system prompts or few-shot examples to expensive LLM APIs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:01:39.966Z","isFirstParty":false}