# fittings Language Detection

> fittings Language Detection is a paid API for AI agents from fittings.sh, paid per call via x402, $0.0042/call, status unknown (last checked 2026-09-14).

Detects the language of a text snippet, returning ISO 639-1 and 639-3 codes, Unicode script, confidence score, and runner-up candidates.

## Facts

- Endpoint: POST https://fittings.sh/v1/lang/detect
- Price: $0.0042/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-language-detection-a834791b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_c-42RdmT1ycs8ccAmJZ3K

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 fittings-language-detection-a834791b -d '<json body>'
```

Example prompt: What language is this text written in — can you give me the ISO 639-1 code and a confidence score? The text is: 'Bonjour, comment allez-vous aujourd'hui?'

## When to prefer this

Choose this endpoint when you need language identification with explicit confidence scoring and ISO-standard codes (both 639-1 and 639-3), especially when handling Latin-script or Cyrillic-script languages that require function-word profiling to disambiguate (e.g. Spanish vs Portuguese, Russian vs Ukrainian). Prefer it over generic NLP pipelines when you want a lightweight, pay-per-call service that safely returns 'und' rather than hallucinating a language for ambiguous input.

## Known failure modes

- Text too short to confidently classify — returns 'und' instead of guessing
- Highly mixed-language text may produce low confidence scores across all candidates
- Text exceeding 20000 UTF-8 bytes will be rejected
- Closely related languages in the same script (e.g. Malay vs Indonesian) may return low confidence
- Empty or whitespace-only input returns 'und'

## How this service works

Detect the language of a text snippet: ISO 639-1 and 639-3 codes, the Unicode script, a confidence score and runner-up candidates. Latin and Cyrillic languages are separated by function-word profile, other scripts by script; answers 'und' rather than guessing when there is no evidence.

## Output

Returns the detected language as ISO 639-1 (e.g. 'fr') and ISO 639-3 (e.g. 'fra') codes, the Unicode script family (e.g. 'Latin'), a numeric confidence score, and an ordered list of runner-up language candidates. Returns 'und' when there is insufficient evidence to make a determination.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Text to classify, up to 20000 UTF-8 bytes"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-language-detection-a834791b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
