Google Translate API costs $20 per million characters. DeepL's free tier caps at 500,000 characters/month with mandatory API key registration. For a side project that needs basic translation, that's overkill.
I built a free AI Translation API powered by Cloudflare AI (Meta's multilingual model) that supports 44 languages with zero configuration. No billing account, no OAuth, no SDK — just an HTTP request.
Supported Languages
English, Spanish, French, German, Italian, Portuguese, Dutch, Polish, Russian, Chinese, Japanese, Korean, Arabic, Hindi, Turkish, Vietnamese, Thai, Indonesian, Czech, Romanian, Danish, Finnish, Hungarian, Norwegian, Swedish, Ukrainian, Bulgarian, Greek, Croatian, Slovak, Slovenian, Serbian, Lithuanian, Latvian, Estonian, Maltese, Irish, Welsh, Afrikaans, Swahili, Hausa, Igbo, Yoruba, Zulu.
Quick Start
curl -X POST "https://ai-translate-api.p.rapidapi.com/translate" \
-H "Content-Type: application/json" \
-d '{
"text": "The quick brown fox jumps over the lazy dog",
"source": "en",
"target": "ja"
}'
Response:
{
"translated_text": "素早い茶色の狐が怠惰な犬を飛び越える",
"source_language": "en",
"target_language": "ja",
"model": "meta-multilingual"
}
JavaScript — Internationalize Your App
async function translate(text, source, target) {
const response = await fetch(
'https://ai-translate-api.p.rapidapi.com/translate',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text, source, target })
}
);
const data = await response.json();
return data.translated_text;
}
// Translate UI strings
const greeting = await translate('Welcome back!', 'en', 'es');
console.log(greeting); // "¡Bienvenido de nuevo!"
// Batch translate
const languages = ['es', 'fr', 'de', 'ja', 'ko'];
const translations = await Promise.all(
languages.map(lang => translate('Hello, world!', 'en', lang))
);
console.log(translations);
// ["¡Hola, mundo!", "Bonjour, le monde!", "Hallo, Welt!", "こんにちは、世界!", "안녕하세요, 세계!"]
Python — Translate Content Files
import requests
import json
def translate(text: str, source: str, target: str) -> str:
response = requests.post(
"https://ai-translate-api.p.rapidapi.com/translate",
json={"text": text, "source": source, "target": target},
timeout=15
)
response.raise_for_status()
return response.json()["translated_text"]
# Translate a JSON locale file
with open("en.json") as f:
en_strings = json.load(f)
ja_strings = {}
for key, value in en_strings.items():
ja_strings[key] = translate(value, "en", "ja")
print(f" {key}: {ja_strings[key]}")
with open("ja.json", "w", encoding="utf-8") as f:
json.dump(ja_strings, f, ensure_ascii=False, indent=2)
Use Cases
| Scenario | How |
|---|---|
| i18n for side projects | Translate UI strings without paying for Google Cloud |
| Chat apps | Real-time message translation between users |
| Content tools | Auto-translate blog posts or product descriptions |
| Email templates | Localize transactional emails |
| Documentation | Quick-translate README files |
Comparison
| Feature | This API | Google Translate | DeepL Free |
|---|---|---|---|
| Price | Free (500 req/mo) | $20/M chars | Free (500K chars/mo) |
| Auth required | No | Yes (billing account) | Yes (API key) |
| Languages | 44 | 100+ | 31 |
| Setup time | 0 minutes | 15–30 minutes | 5 minutes |
| Cold start | None | None | None |
If you need 100+ languages or neural machine translation quality for production, Google or DeepL are better. For side projects, prototypes, and internal tools — this is faster to integrate and costs nothing.
Part of a collection of 24 free developer APIs — all running on Cloudflare Workers.
Top comments (0)