{"uid":"cap_-vd5oHa9rtEEkZAHxYA_i","slug":"agent402-tools-gzip-compress-cb91af63","name":"agent402.tools Gzip Compress","description":"Compress a string with gzip (RFC 1952) and return it as base64. Reports input bytes, output bytes, and the compression ratio so you can decide if it was worth doing. Input can be plain text (utf8) or already-binary content (base64 or hex).","url":"https://agent402.tools/api/gzip","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"string","description":"Content to compress (max 10MB after decoding)"},"level":{"type":"number","description":"Compression level 1-9 (default 9 = best ratio, slower)"},"inputFormat":{"type":"string","description":"How `input` is encoded: utf8 (default), base64, or hex"}}},"responseSchema":{"type":"json","example":{"ratio":0.4878,"output":"H4sIAA…","algorithm":"gzip","inputBytes":41,"outputBytes":21}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2XWKDB38h2EC88vzpQR5f","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses a string using gzip (RFC 1952) and returns the result as base64, along with input/output byte counts and compression ratio.","exampleAgentPrompt":"Can you gzip-compress this JSON string at compression level 9 and give me the base64 output along with how much it shrank: '{\"userId\":\"abc123\",\"events\":[\"login\",\"purchase\",\"logout\"],\"timestamp\":\"2024-01-15T10:30:00Z\"}'?","exampleUseCases":null,"resultDescription":"Returns the gzip-compressed content encoded as base64, along with the original input byte size, the compressed output byte size, and the compression ratio — so the caller can evaluate whether compression was worthwhile.","failureModes":["Input exceeds 10MB limit after decoding — returns error","Invalid inputFormat value (not utf8, base64, or hex) — returns validation error","Compression level outside 1-9 range — returns validation error","Malformed base64 or hex input when inputFormat is base64 or hex — decode error","Payment not provided or insufficient — 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need to gzip-compress arbitrary text or binary content (provided as utf8, base64, or hex) and receive a base64-encoded result suitable for embedding in JSON, along with compression statistics. Prefer this over client-side compression when the agent runtime lacks native gzip support or when you need the compression ratio metric to decide whether compression is worth applying.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:41:46.821Z","isFirstParty":false}