# 402utils Language Detector

> 402utils Language Detector is a paid API for AI agents from 402utils.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Detects the language of input text using a trigram model, returning ISO 639-1/639-3 code, language name, confidence margin, reliability flag, and ranked alternatives.

## Facts

- Endpoint: POST https://402utils.com/v1/lang-detect?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-language-detector-accf452a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PTxYH2k1NTkbjyX-Xgy7C

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 402utils-language-detector-accf452a -d '<json body>'
```

Example prompt: What language is this text written in, and how confident are you? 'Le chat est sur la table, bien sûr.' — give me the ISO code, language name, and whether the detection is reliable.

## When to prefer this

Use this endpoint as the pre-sort step in any multilingual pipeline when you need a fast, offline-style trigram detection without calling a heavyweight LLM or external language API. Prefer it when you need explicit confidence margins and a reliable flag to decide whether to trust the result, and when processing text in European, CJK, or Indic scripts. Ideal for routing, tagging, or filtering content by language at scale at $0.001/call.

## Known failure modes

- Very short or single-word text returns reliable:false because the trigram model needs ~10+ characters for meaningful signal
- Highly ambiguous or mixed-language text returns a low confidence margin with reliable:false
- Text with only numbers, symbols, or punctuation may not resolve to a meaningful language
- Languages outside the supported 61+ may be misclassified as a closest-matching supported language

## How this service works

Detect the language of a text with franc (pure-JS trigram model, 61 languages + CJK/Indic scripts). Returns the ISO 639-1 code (639-3 when no 2-letter code exists), language name, a separation-margin confidence (0=ambiguous, 1=unambiguous), a reliable flag, and ranked alternatives. The pre-sort step of any multilingual pipeline. Short/ambiguous text returns reliable:false honestly. Processes provided text only; nothing is fetched.

## Output

Returns the detected ISO 639-1 (or 639-3 where no 2-letter code exists) language code, human-readable language name, a separation-margin confidence score between 0 (ambiguous) and 1 (unambiguous), a boolean reliable flag, and an ordered list of alternative candidate languages with their scores.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "The text to classify (needs ~10+ characters to be reliable)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-language-detector-accf452a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
