# Language Detection

> Language Detection is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Identifies which of 20 common languages (or 'other') a text is written in, returning a language label and confidence score, with LLM fallback for reliability.

## Facts

- Endpoint: GET https://x402.agentindex.world/language?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/language-detection-5a874ea2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HpVTARvVQPNPMfgVAsxJG

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 language-detection-5a874ea2
```

Example prompt: What language is this text written in, and how confident are you? 'Le soleil brille sur la ville de Paris ce matin.'

## When to prefer this

Choose this endpoint when you need fast, cheap, per-call language detection with a confidence score and a guaranteed sub-4.5s response time. Ideal for classifying short-to-medium texts (up to 4000 characters) in pipelines where cost per call matters and you need the reliability of a dual-engine fallback (Jev + Groq LLM). Not ideal for bulk batch jobs or for detecting rare languages outside the 20 supported.

## Known failure modes

- Text exceeds 4000 characters — truncation or rejection required
- Very short or ambiguous text may yield low confidence scores or 'other'
- Language not among the 20 supported returns 'other' rather than a specific label
- Jev and LLM fallback both unavailable — request times out beyond 4.5s SLA
- Payment failure or insufficient USDC balance blocks the call

## How this service works

Language detection: identify which of 20 common languages (or "other") a text is written in, with a confidence score. Powered by Jev, with an automatic Groq-hosted LLM fallback if Jev is slow or unavailable - under 4.5s guaranteed. Try GET /language/sample.

## Output

Returns a language label (e.g. 'French', 'Spanish', 'other') and a numeric confidence score indicating how certain the model is about the detected language.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Text to classify, up to 4000 characters."
  }
 }
}
```

## More

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