Translate text API: any language to any language with detection
No account. Pay by card from $1 and your key appears right after payment. Get a key by card
Translate text between languages with an open LLM (gpt-oss-20b; M2M100 for less common languages): the source language is detected, the target is an ISO code such as en, sv, de, fr, es, zh or ja, and long text is split at sentence ends and checked so a cut-off translation is never charged. Use to localise messages, documents, product copy and support replies.
Inputs
| Name | Type | Description |
|---|---|---|
text (required) | string | Text, up to 4,000 characters |
to (required) | string | Target language code, e.g. sv |
from | string | Source language code (default: detected) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://glyphtools.com/ai/translate-text?text=Payment%20received%2C%20thank%20you!&to=sv"
Node.js
const r = await fetch("https://glyphtools.com/ai/translate-text?text=Payment%20received%2C%20thank%20you!&to=sv", {
headers: { Authorization: "Bearer adt_…" },
});
const data = await r.json(); // 402 until the key is in the header
Python
import requests
r = requests.get("https://glyphtools.com/ai/translate-text?text=Payment%20received%2C%20thank%20you!&to=sv", headers={"Authorization": "Bearer adt_…"}, timeout=60)
data = r.json()
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"translatedText": "Betalning mottagen, tack!",
"from": "en",
"to": "sv",
"chars": 28,
"chunks": 1,
"model": "@cf/openai/gpt-oss-20b"
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is ai_translate_text, paid from the first call:
https://glyphtools.com/mcp