# WritersLogic Enum Canonicalization

> WritersLogic Enum Canonicalization is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Maps arbitrary input strings to their canonical form within a caller-defined closed set using exact match, aliases, normalization, and bounded edit distance — abstaining rather than guessing on ambiguous or out-of-range inputs.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/enum-canonicalize?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-enum-canonicalization-f79d452e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2_D9T55jFylX_BQ4zzLmI

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 writerslogic-enum-canonicalization-f79d452e -d '<json body>'
```

Example prompt: Canonicalize these status strings — ['Activ', 'CLOSED', 'pendin', 'Suspended'] — against the allowed set ['Active','Closed','Pending','Suspended'] using a max edit distance of 2, so I can safely write them to a typed status column.

## When to prefer this

Choose this endpoint when you need deterministic, verifiable string-to-enum canonicalization with no guessing or semantic inference — ideal for ETL pipelines, database column cleaning, and agent workflows that must write to typed columns. Prefer it over LLM-based normalization when auditability, consistency, and abstention on ambiguity are required. It is not suitable when you need translation, synonym expansion beyond your alias list, or fuzzy semantic matching.

## Known failure modes

- Abstains (returns null) when no allowed value is within the specified maxDistance threshold
- Abstains (returns null) when two allowed values tie at the same minimum edit distance
- Returns error if 'allowed' set is empty or missing
- Returns error if any alias canonical value is not present in the allowed set
- Returns error if input values array is empty or exceeds 200 items
- Returns error if aliases array exceeds 500 entries
- May fail to match highly abbreviated or acronym inputs if no alias is supplied, since it does not use synonyms or semantic inference

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

For each input string, returns the matched canonical value (or null if no match within threshold or if there's a tie), the method used to match (exact, alias, normalized, edit-distance), the edit distance computed, and the nearest candidate values considered. The response is deterministic and never infers meaning beyond what is supplied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "values": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 200,
   "minItems": 1,
   "description": "Strings to canonicalize."
  },
  "aliases": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "alias",
     "canonical"
    ],
    "properties": {
     "alias": {
      "type": "string",
      "maxLength": 100
     },
     "canonical": {
      "type": "string",
      "maxLength": 100
     }
    },
    "additionalProperties": false
   },
   "maxItems": 500,
   "description": "Caller synonyms; each canonical must be in allowed."
  },
  "allowed": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100
   },
   "maxItems": 500,
   "minItems": 1,
   "description": "The closed set of canonical values."
  },
  "maxDistance": {
   "type": "integer",
   "maximum": 5,
   "minimum": 0,
   "description": "Largest edit distance accepted (default 2). The effective limit is also capped at one third of the normalized input length."
  },
  "caseSensitive": {
   "type": "boolean",
   "description": "Skip case, accent and punctuation folding (only NFKC and whitespace collapse). Default false."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-enum-canonicalization-f79d452e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
