What it does
Send a string. Get back a slug.
curl -X POST https://x402.agentutility.ai/slugify \
-d '{"text":"Café & Bar @ 100% — Open 24/7!","max_length":40}'
{
"input": "Café & Bar @ 100% — Open 24/7!",
"slug": "cafe-and-bar-at-100-percent-open-24-7",
"mode": "kebab",
"length": 37,
"tokens": ["cafe", "and", "bar", "at", "100", "percent", "open", "24", "7"],
"truncated": false
}
$0.001 USDC. Cheapest endpoint in the catalog.
Why charge for slugification at all
Reasonable question.
Most slug libraries handle the common case fine: lowercase, hyphenate, strip punctuation. But here's where they diverge:
José Pérez→ some libraries returnjose-perez, some returnjose-prez(dropping the accent and the letter behind it), some leave the accents inCafé & Bar→ some libraries returncafe-bar(dropped the&), some returncafe-and-bar(replaced it)Open 24/7→ some returnopen-247, some returnopen-24-71ère édition→ behavior depends on whether the library does NFKD or NFC normalization
An agent that needs deterministic, predictable slug behavior across every input — say, for cache keys that have to match across services — can't tolerate that ambiguity. So you write your own. Or you call a paid endpoint that documents the exact behavior:
- NFKD normalization, then combining-mark strip (
José→Jose→jose) - Symbol replacement before normalization (
&→and,%→percent,@→at,#→hash,+→plus) - All non-alphanumerics collapsed to the separator
- Word-boundary-aware truncation when
max_lengthis set
Same input, same output, every time. Deterministic.
Four modes
kebab: lower-kebab-case snake: lower_snake_case dot: lower.dot.case preserve_case: Same-Separators-But-Casing-Preserved
Default is kebab because that's what URLs and SEO conventions want. snake for Python identifiers and database column names. dot for Maven artifact IDs and Java package paths. preserve_case for filename slugs where case matters.
Unicode handling
ascii_only: true (default) strips accents and converts to ASCII. ascii_only: false keeps Unicode letters and numbers through (so 森林公园 slugs to 森林公园, and Москва slugs to москва).
The cutoff matters for non-Latin scripts. ASCII-only on Chinese or Cyrillic produces an empty slug — there's no fallback transliteration baked in. We don't pretend to know whether you want pinyin or romanization. Pass ascii_only: false and handle the script in your downstream code.
Truncation
If max_length is set and the slug exceeds it, the endpoint truncates at the nearest word boundary within the last half of the limit. So text: "the quick brown fox jumps over the lazy dog", max_length: 25 returns the-quick-brown-fox-jumps, not the-quick-brown-fox-jumps-o. The word-boundary cut preserves readability of the slug as a URL.
If no good boundary exists (one long word), we cut at the literal max.
At $0.001 the unit math is unusual
A million slug calls is $1000. That's enough that any high-volume use case should still call this. But for the low-volume case, an agent that needs five slugs is paying half a cent. Below the price point where most paid APIs even bother to publish a price.
We can charge $0.001 because the call is cheap: one regex pass, one string join, no upstream fetches, no LLM. The price floor sets a precedent: even the simplest text utility can be paid-callable when the cost is right.