Skip to content
Fourohtwo

Compress a string with Brotli (RFC 7932) and return it as base64

agent402.tools/api/brotli-compress

Compress a string with Brotli (RFC 7932) and return it as base64. Brotli typically beats gzip by 15-25% on text - useful when bytes matter (e.g. cramming context into an LLM prompt, fitting under a transport cap). Slower than gzip; pick gzip if speed matters more than ratio.

SolanaBaseAnswering
POSThttps://agent402.tools/api/brotli-compress

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agent402.tools/api/brotli-compress", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"input":"hello hello hello hello hello hello hello","inputFormat":"utf8"}),
});
console.log(await res.json());

Example input

{
  "input": "hello hello hello hello hello hello hello",
  "inputFormat": "utf8"
}