# agent402.tools Slug Generator

> agent402.tools Slug Generator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Converts any arbitrary string into a URL-safe slug, handling accented characters, collapsing hyphens, and optionally truncating at a word boundary.

## Facts

- Endpoint: GET https://agent402.tools/api/slug-generate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-slug-generator-f6646983
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_t9JbKkuvOO7-UFqwN6e1R

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-slug-generator-f6646983
```

Example prompt: Turn 'Héllo Wörld: A Beginner's Guide to Résumé Writing!' into a URL-safe slug, and keep it under 50 characters.

## When to prefer this

Use this endpoint when you need reliable slug generation with proper Unicode/NFD normalization for accented characters and word-boundary-aware truncation, especially when handling multilingual or user-generated content titles that must become valid URL path segments.

## Known failure modes

- Missing required 'text' query parameter returns an error
- Non-numeric maxLength value may cause unexpected behavior
- Empty string input may return an empty or minimal slug
- Extremely long inputs without maxLength may produce very long slugs

## How this service works

Generate a URL-safe slug from any string. Handles accented characters (normalize NFD), replaces non-alphanumeric with hyphens, collapses and trims. Optional max-length with word-boundary truncation.

## Output

A lowercase, hyphen-separated, URL-safe slug string derived from the input text, with accented characters normalized and non-alphanumeric characters replaced, optionally truncated at a word boundary to the specified max length.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Text to slugify"
      },
      "maxLength": {
       "type": "number",
       "description": "Maximum slug length (optional, truncates at word boundary)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "slug": "hello-world-this-is",
  "length": 19,
  "original": "Hello World! This is a Test."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-slug-generator-f6646983/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
