Endpoint
POST /v3/universal-ai (sync)
Model string pattern: translation/automatic_translation/{provider}[/{model}]
Input
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text to translate |
| target_language | string | Yes | Target language code |
| source_language | string | No | Source language code |
Output
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | Yes |
Available Providers
| Provider | Model String | Price |
|---|---|---|
| amazon | translation/automatic_translation/amazon | $15 per 1,000,000 chars |
| deepl | translation/automatic_translation/deepl | $20 per 1,000,000 chars |
translation/automatic_translation/google | $20 per 1,000,000 chars | |
| microsoft | translation/automatic_translation/microsoft | $10 per 1,000,000 chars |
| modernmt | translation/automatic_translation/modernmt | $8 per 1,000,000 chars |
| openai | translation/automatic_translation/openai | $20 per 1,000,000 tokens |
| openai (gpt-4o) | translation/automatic_translation/openai/gpt-4o | $20 per 1,000,000 tokens |
Quick Start
import requests
url = "https://api.edenai.run/v3/universal-ai"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "translation/automatic_translation/amazon",
"input": {
"text": "The quick brown fox jumps over the lazy dog.",
"target_language": "fr",
"source_language": "en"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
curl -X POST https://api.edenai.run/v3/universal-ai \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "translation/automatic_translation/amazon",
"input": {"text": "The quick brown fox jumps over the lazy dog.", "target_language": "fr", "source_language": "en"}
}'