Skip to content
Fourohtwo

Use when an agent needs a web-ready image

baconservices.com/api/agent-commerce/v1/capabilities/web-image-optimizer/execute

Use when an agent needs a web-ready image: shrinks a PNG, JPEG or WebP to a maximum width and converts it to WebP, keeping transparency.

BaseUnchecked
POSThttps://baconservices.com/api/agent-commerce/v1/capabilities/web-image-optimizer/execute

UptimeNot checked yet

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

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://baconservices.com/api/agent-commerce/v1/capabilities/web-image-optimizer/execute", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"image_url":"https://baconservices.com/assets/img/demos/background-remover-before.png","max_width":1600,"quality":80}),
});
console.log(await res.json());

Example input

{
  "image_url": "https://baconservices.com/assets/img/demos/background-remover-before.png",
  "max_width": 1600,
  "quality": 80
}

More from Bacon Services