Lingua Detective for AI agents

API and benchmark JSON currently use French field names; English aliases are not available. See the field documentation.

Pay-per-call language intelligence over x402 (USDC on Solana, gas sponsored): detect and verify the language of any text, offline. No account, no API key, no subscription.

TL;DR for agents: unauthenticated calls receive HTTP 402 with a PAYMENT-REQUIRED header. Pay a few tenths of a cent in USDC on Solana mainnet via the facilitator https://x402.dexter.cash (gas sponsored — you only need USDC, not SOL), retry with the payment proof, get your answer. Machine-readable entry points: llms.txt · .well-known/x402 · MCP server npx -y lingua-x402-mcp.

Endpoints and prices

EndpointPrice per callWhat it does
POST /detect$0.002Detect the language(s) of a text — ISO 639-3, offline, top-5 with confidence. Body: {"text":"..."}.
POST /verify$0.004Verify a text is written in the expected language (ISO 639-1 or 639-3). Body: {"text":"...","expected":"fra"}.
POST /crawl$0.006–$0.020 / pageCrawl a site and verify the language of each page, or verify a batch of URLs. Progressive cumulative tiers; minimum $0.01/run.
POST /api/auditsame tiers as /crawlFull multilingual audit: score, classification, confidence, evidence, next steps — JSON plus a copy-pasteable Markdown report.
POST /v1/bundle/check$0.006Buy a prepaid bundle — returns an X402-Credit token.
POST /v1/credit/topupflexible (min $0.006)Top up prepaid credit — each later call debits the credit without a new Solana transaction.

MCP server

The MCP server lingua-x402-mcp exposes four paid tools (detect_langue, verifier_langue, bundle_check, credit_topup) over stdio:

{
  "mcpServers": {
    "linguadetective": {
      "command": "npx",
      "args": ["-y", "lingua-x402-mcp"],
      "env": {
        "X402_PAYER_KEY_B64": "<your base64 private key>",
        "X402_TRUSTED_PAYTO": "H3NuGHu9mpGgscj2DWtrs699PWdovPUicy2N9dDaYLTk"
      }
    }
  }
}

Two payment modes: payer wallet (X402_PAYER_KEY_B64 — each call settles its own x402 transaction) or prepaid credit (X402_CREDIT_TOKEN — debits without a Solana transaction). With neither, tools return the decoded 402 challenge so the agent understands what is being requested.

Payment details (x402)

Why agents pick this API

Quickstart (curl)

# 1. Call without payment → HTTP 402 challenge
curl -i -X POST https://linguadetective.com/detect \
  -H 'Content-Type: application/json' \
  -d '{"text":"Bonjour tout le monde"}'

# 2. Settle the challenge in USDC via the facilitator, then retry with
#    the payment proof header → 200 OK with the detection result.

Full walkthrough in the API docs.