# CoCo Language Detection API

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

Detects the natural language of a given text string and returns the identified language code with confidence score

## Facts

- Endpoint: GET https://cocoeatsai.com/area4/agent/tools/language?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coco-language-detection-api-fd08d9d0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KTLEzw80Qt79wHClvltk4

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 coco-language-detection-api-fd08d9d0
```

Example prompt: Can you detect what language this text is written in: 'Bonjour, comment ça va?'

## When to prefer this

Use this endpoint when you need lightweight, fast language detection on a text snippet and want a simple JSON response with a language code and confidence score. It is ideal for pre-processing pipelines, routing decisions, or validating user input language before forwarding to a translation or localization service. Prefer it for single-text, low-latency detection calls where the $0.001 per-call pricing is acceptable.

## Known failure modes

- Empty or missing text query parameter returns an error or undefined behavior
- Very short text (single character or word) may yield low confidence or incorrect detection
- Highly mixed-language text may produce ambiguous results with split confidence across candidates
- Extremely rare or constructed languages may not be recognized
- Request timeout if upstream service is unavailable

## How this service works

Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.

## Output

Returns a JSON object containing the detected language code (e.g. 'en' for English), a confidence score between 0 and 1, and an array of candidate languages each with a probability score. Example: {"language":"en","candidates":[{"p":1,"lang":"en"}],"confidence":1}

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ]
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "text": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "language"
     ],
     "properties": {
      "language": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "language": "en",
  "candidates": [
   {
    "p": 1,
    "lang": "en"
   }
  ],
  "confidence": 1
 },
 "exampleNote": "Computed offline with demonstration inputs; time/random values are illustrative."
}
```

## More

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