Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Use /v1/translations for text-to-text translation.
This endpoint is different from Audio Translation, which accepts an audio file and always outputs English text.
For agent workflows, discover the current recommended translation models first:
curl "https://api.lemondata.cc/v1/models?recommended_for=translation" \
  -H "Authorization: Bearer sk-your-api-key"
Then explicitly send the chosen model to /v1/translations.
recommended_for=translation applies only to text translation (POST /v1/translations). It does not apply to audio translation.

Request Body

model
string
required
Translation model ID returned by /v1/models?recommended_for=translation.
text
string
required
Source text to translate.
target_language
string
required
Target language code or language name, depending on model support.
source_language
string
Optional source language hint.
mime_type
string
default:"text/plain"
Source text format. Supported values: text/plain, text/html.
user
string
Optional end-user identifier for abuse monitoring and request tracing.

Response

text
string
Translated text.
model
string
Model that generated the translation.
source_language
string | null
Source language detected or accepted by the model.
target_language
string
Target language used for the request.
curl -X POST "https://api.lemondata.cc/v1/translations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-translation-pro",
    "text": "你好,欢迎使用 LemonData。",
    "target_language": "en"
  }'
{
  "text": "Hello, welcome to LemonData.",
  "model": "gemini-translation-pro",
  "source_language": "zh",
  "target_language": "en"
}