Skip to content
Fourohtwo

Render a Mustache-style template with JSON data

agents.204-168-199-108.sslip.io/v1/util/template

Render a Mustache-style template with JSON data — emails, messages, prompts, reports: {{var}} and dotted names ({{customer.name}}), {{{raw}}}, sections that loop over lists ({{#items}}…{{/items}}), conditionals and inverted sections ({{^paid}}…{{/paid}}), comments. Returns the rendered text, the variables used and the variables that were missing from the data (so an agent can fill gaps before send

BasePolygonSolanaaws:baseAnswering
GEThttps://agents.204-168-199-108.sslip.io/v1/util/template

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://agents.204-168-199-108.sslip.io/v1/util/template?data=%7B%22customer%22%3A%7B%22name%22%3A%22Ada%22%7D%2C%22order_id%22%3A4521%2C%22items%22%3A%5B%7B%22qty%22%3A2%2C%22name%22%3A%22Widget%22%7D%2C%7B%22qty%22%3A1%2C%22name%22%3A%22Cable%22%7D%5D%2C%22paid%22%3Afalse%7D&template=Hi+%7B%7Bcustomer.name%7D%7D%2C+your+order+%23%7B%7Border_id%7D%7D%3A%0A%7B%7B%23items%7D%7D%0A-+%7B%7Bqty%7D%7D+x+%7B%7Bname%7D%7D%0A%7B%7B%2Fitems%7D%7D%0A%7B%7B%5Epaid%7D%7DPayment+is+still+due.%7B%7B%2Fpaid%7D%7D");
console.log(await res.json());

Example input

{
  "data": "{\"customer\":{\"name\":\"Ada\"},\"order_id\":4521,\"items\":[{\"qty\":2,\"name\":\"Widget\"},{\"qty\":1,\"name\":\"Cable\"}],\"paid\":false}",
  "template": "Hi {{customer.name}}, your order #{{order_id}}:\n{{#items}}\n- {{qty}} x {{name}}\n{{/items}}\n{{^paid}}Payment is still due.{{/paid}}"
}