Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/enum-canonicalize

Maps each input string onto one member of a closed caller-supplied set using, in order: exact match, caller aliases, a deterministic normal form (Unicode NFKC, case and accent folding, punctuation and underscore collapse), then bounded edit distance (optimal string alignment, so a swapped pair of letters costs 1). Returns the canonical value, the method, the distance and the nearest candidates; it

BaseUnchecked
POSThttps://agents.writerslogic.com/api/v1/enum-canonicalize

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://agents.writerslogic.com/api/v1/enum-canonicalize", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"values":["Unted States","usa","U.S. of America","Atlantis"],"aliases":[{"alias":"usa","canonical":"United States"},{"alias":"u s of america","canonical":"United States"}],"allowed":["United States","Canada","Mexico"]}),
});
console.log(await res.json());

Example input

{
  "values": [
    "Unted States",
    "usa",
    "U.S. of America",
    "Atlantis"
  ],
  "aliases": [
    {
      "alias": "usa",
      "canonical": "United States"
    },
    {
      "alias": "u s of america",
      "canonical": "United States"
    }
  ],
  "allowed": [
    "United States",
    "Canada",
    "Mexico"
  ]
}