# x402 Language Detection API

> x402 Language Detection API is a paid API for AI agents from call402.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-30).

Detects the language of a given text string, returning the identified language, confidence level, and alternative language candidates

## Facts

- Endpoint: POST https://call402.com/api/language-detect?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-language-detection-api-ff78365d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uhTLnca3eRBt4Su7GLNtH

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 x402-language-detection-api-ff78365d -d '<json body>'
```

Example prompt: What language is this text written in: 'Bonjour, comment allez-vous aujourd'hui?'

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call language detection service with no subscription commitment, especially in agentic or automated pipelines that use the x402 USDC micropayment protocol on Base mainnet. It is a good fit when you want confidence scores and ranked alternative language candidates alongside the primary detection result, and when you want deterministic per-call pricing at $0.005 USDC rather than monthly API quota plans.

## Known failure modes

- Empty or missing 'text' field returns a validation error
- Very short or ambiguous text (e.g. single characters, numbers only) may return low confidence or incorrect detection
- Payment not included causes HTTP 402 with payment requirements before the call is processed
- Network errors or malformed JSON body cause request failures
- Text in rare or unsupported languages may return low-confidence results or misclassify to a related language

## How this service works

USDC pay-per-call APIs for AI agents via the x402 protocol (v2, exact, Base mainnet). Send a request, receive HTTP 402 with payment requirements, pay with @x402/fetch or any x402 client, retry with the PAYMENT-SIGNATURE header.

## Output

Returns a JSON object containing the detected language as an ISO language code (e.g. 'fr'), a human-readable language name (e.g. 'French'), a confidence level string (e.g. 'high'), and an array of alternative language candidates each with a language code and numeric score between 0 and 1.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Text to detect, required"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "language": "fr",
  "confidence": "high",
  "alternatives": [
   {
    "score": 0.9,
    "language": "fr"
   },
   {
    "score": 0.1,
    "language": "it"
   }
  ],
  "language_name": "French"
 }
}
```

## More

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