Translation API: translate text between languages
Translate text into another language with OpenAI's open-weight gpt-oss-20b, detecting the source language. Long text is split at sentence ends and checked, so a cut-off translation is an uncharged 502, never a success. Give the target as an ISO code such as en, sv, de, fr, es, zh or ja; less common languages use Meta's M2M100. Use to localise messages and documents.
When to use it
- Localise messages and documents
- Translate up to 4,000 characters with a target ISO code such as en, sv, de, fr, es, zh or ja
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://tools.funwords.eu/ai/translate?text=Payment%20received%2C%20thank%20you!&to=sv"
Or one of your 25 free calls, no key:
curl "https://tools.funwords.eu/ai/translate?text=Payment%20received%2C%20thank%20you!&to=sv&trial=1"
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, and the first 25 successful calls are free:
https://tools.funwords.eu/mcp
Questions
Which model?
OpenAI's open-weight gpt-oss-20b for common languages and Meta's M2M100 for the rest; the source language is optional and detected when left out.
How do I pay?
Each successful call costs $0.01; failed calls are not charged. The first 25 calls are free. Then pay with card credits (from $1; the key goes in an Authorization header or, for clients that can only fetch a URL, as api_key= in the URL) or per call in USDC over x402 or MPP. No account is needed.