Translation API
KrosAI's translation API allows you to translate text between multiple languages with high accuracy, especially for African languages.
This endpoint is OpenAI compatible
Overview
The API automatically detects the source language and translates content to your desired target language.
Endpoint
POST https://api.krosai.com/v1/audio/translations
This endpoint transcribes audio and translates it to English in one step.
Request Parameters
file
file
Yes
The audio file to transcribe and translate (mp3, mp4, wav, m4a, webm)
model
string
No
Model to use (default: "KrosMLingualSTT1.0.0")
prompt
string
No
Text to guide the translation
response_format
string
No
Output format (default: "json")
temperature
float
No
Model temperature (default: 0.0)
Example Request (cURL)
curl https://api.krosai.com/v1/audio/translations \
-H "Authorization: Bearer $API_KEY" \
-F file=@"recording.mp3" \
-F model="KrosMLingualSTT1.0.0"
Response Format
{
"id": "trans_1234567890",
"object": "translation",
"created": 1682456789,
"model": "KrosMLingualSTT1.0.0",
"text": "This is the translated text from the audio file.",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 45,
"total_tokens": 45
}
}
Best Practices
Translation
For multi-step translations, use the legacy endpoint
Consider context when translating specialized content
Test with small samples before processing large batches
Error Handling
All APIs return standard HTTP status codes:
200: Success
400: Bad request (check parameters)
401: Unauthorized (check API key)
429: Rate limit exceeded
500: Server error
Error responses include a detail field with more information about the error.
Last updated