KrosAI Docs
DashboardGet Started
  • Getting Started
    • Introduction
    • Quickstart Guide
    • Authentication
  • OpenAI SDK Compatability
  • Endpoints
    • Completions API
      • Create Chat Completion
    • Translation API
    • Text Summarization API
    • Audio Transcription API
    • Sentiment Analysis API
  • AGENT
    • Agents API
      • Create Agent
      • List Agents
      • Get Agent
      • Update Agent
      • Delete Agent
      • Start Voice Session
    • Conversations API
      • Create Conversation
      • List Conversations
      • Get Conversation
      • Get Conversation Messages
    • Knowledge Base API
      • Create Knowledge Base
      • List Knowledge Base
      • Upload Document
      • List Document
  • Resources
    • AI Voice Agents
    • In-App Voice Assistants
    • Virtual Health Assistants
    • EdTech Language Tutors
  • SDKS
    • Node.JS SDK
    • React Native SDK
    • Flutter
Powered by GitBook
On this page
  • Best Practices
  • Error Handling
  1. Endpoints

Translation API

KrosAI's translation API allows you to translate text between multiple languages with high accuracy, especially for African languages.

PreviousCreate Chat CompletionNextText Summarization API

Last updated 1 month ago

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

Parameter
Type
Required
Description

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.

This endpoint is OpenAI compatible