시작하기
TranslateAPI는 180개 이상의 언어 사이에서 텍스트를 번역하는 간단한 REST 인터페이스를 제공합니다. 모든 API 엔드포인트는 JSON 응답을 반환합니다.
1. Get Your API Key
Create a free account and generate your API key from the dashboard:
- Sign up at translateapi.ai/signup
- Go to 대시보드 → API 키
- Click "Create API Key" and copy your key
API keys start with ta_ followed by 56 hex characters.
https://api.translateapi.ai/api/v1/2. Make Your First Request
Replace YOUR_API_KEY with the key from your dashboard:
curl -X POST https://api.translateapi.ai/api/v1/translate/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"text": "Hello, world!",
"target_language": "es"
}'
import requests
response = requests.post(
"https://api.translateapi.ai/api/v1/translate/",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"text": "Hello, world!",
"target_language": "es"
}
)
result = response.json()
print(result["translated_text"]) # "Hola, mundo!"
const response = await fetch("https://api.translateapi.ai/api/v1/translate/", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Hello, world!",
target_language: "es"
})
});
const result = await response.json();
console.log(result.translated_text); // "Hola, mundo!"
$ch = curl_init("https://api.translateapi.ai/api/v1/translate/");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"text" => "Hello, world!",
"target_language" => "es"
])
]);
$result = json_decode(curl_exec($ch), true);
echo $result["translated_text"]; // "Hola, mundo!"
payload := strings.NewReader(`{
"text": "Hello, world!",
"target_language": "es"
}`)
req, _ := http.NewRequest("POST", "https://api.translateapi.ai/api/v1/translate/", payload)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["translated_text"]) // "Hola, mundo!"
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
var content = new StringContent(
JsonSerializer.Serialize(new {
text = "Hello, world!",
target_language = "es"
}),
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync("https://api.translateapi.ai/api/v1/translate/", content);
var result = JsonSerializer.Deserialize<JsonElement>(
await response.Content.ReadAsStringAsync()
);
Console.WriteLine(result.GetProperty("translated_text")); // "Hola, mundo!"
응답
{
"translated_text": "Hola, mundo!",
"source_language": "en",
"target_language": "es",
"translations": {
"es": "Hola, mundo!"
},
"character_count": 13,
"translation_time": 0.45
}
인증
API 키를 사용하여 요청을 인증할 수 있습니다. 대시보드.
헤더 인증( 권장)
Authorization: Bearer ta_your_api_key_here
ApiKey Header
Authorization: ApiKey ta_your_api_key_here
쿼리 매개 변수
https://api.translateapi.ai/api/v1/translate/?api_key=ta_your_api_key_here
텍스트 번역
단일 대상 언어로 텍스트를 번역합니다.
POST https://api.translateapi.ai/api/v1/translate/
요청 본문
| 파라미터 | 종류 | 필수 | 설명 |
|---|---|---|---|
text |
string | 네 | 번역할 텍스트 (최대 50,000자) |
target_language |
string | 네* | Target language code (e.g., "es", "fr", "de") |
source_language |
string | 아니요 | Source language code. Default: "auto" (auto-detect) |
engine |
string | 아니요 | Translation engine: "auto" (default), "huggingface", or "madlad". See Translation Models. 번역 모델. |
* 사용 target_language (문자열) 단일 언어 또는 target_languages (배열) 다중에 대 한. 참조 다중 대상 번역.
응답
{
"translated_text": "Hola, mundo!",
"source_language": "en",
"target_language": "es",
"translations": {
"es": "Hola, mundo!"
},
"character_count": 13,
"translation_time": 0.45
}
source_language or set it to "auto" to automatically detect the source language. The detected language is returned in the source_language response field.
다중 대상 번역
단일 요청에서 텍스트를 여러 언어로 번역합니다. 단일 번역과 동일한 엔드포인트를 사용합니다.
POST https://api.translateapi.ai/api/v1/translate/
요청 본문
{
"text": "Hello, world!",
"target_languages": ["es", "fr", "de", "ja"],
"source_language": "en"
}
사용 target_languages (배열) 대신 target_language (문자열) 여러 대상에 대 한.
응답
{
"source_language": "en",
"translations": {
"es": "Hola, mundo!",
"fr": "Bonjour, monde!",
"de": "Hallo, Welt!",
"ja": "こんにちは、世界!"
},
"character_count": 52,
"translation_time": 2.31
}
일괄 번역
비동기 처리로 한 번에 여러 개의 텍스트를 번역합니다. 결과에 대한 일괄 처리 및 투표를 제출합니다.
POST https://api.translateapi.ai/api/v1/translate/batch/
1단계: 배치 제출
curl -X POST https://api.translateapi.ai/api/v1/translate/batch/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"texts": ["Hello", "Goodbye", "Thank you"],
"target_language": "es",
"source_language": "en"
}'
응답 (HTTP 202 허용)
{
"job_id": "67535b2b-c9e3-4f82-9499-e237edbc1dd8",
"status": "pending",
"total_texts": 3,
"queue_position": 1,
"source_language": "en",
"target_languages": ["es"],
"character_count": 22,
"credits_remaining": -1,
"poll_url": "https://api.translateapi.ai/api/v1/jobs/67535b2b-c9e3-4f82-9499-e237edbc1dd8/"
}
2단계: 결과에 대한 투표
GET https://api.translateapi.ai/api/v1/jobs/{job_id}/
폴링 예제 (파이썬)
import time, requests
job_id = response.json()["job_id"]
total = response.json()["total_texts"]
headers = {"Authorization": "Bearer YOUR_API_KEY"}
print(f"Batch submitted: {total} texts (job {job_id})")
while True:
result = requests.get(f"https://api.translateapi.ai/api/v1/jobs/{job_id}/", headers=headers).json()
status = result["status"]
processed = result.get("processed_texts", 0)
progress = result.get("progress_percentage", 0)
if status == "completed":
print(f"Done: {processed}/{total} in {result.get('processing_time', 0):.1f}s")
translations = result["result_data"]["translations"]
break
elif status == "failed":
raise Exception(result.get("error_message", "Translation failed"))
elif status == "pending":
print(f"Queued (position {result.get('queue_position', '?')})")
else:
print(f"[{status}] {processed}/{total} ({progress:.0f}%)")
time.sleep(3)
응답 (완료됨)
{
"job_id": "67535b2b-...",
"status": "completed",
"processed_texts": 3,
"total_texts": 3,
"progress_percentage": 100.0,
"processing_time": 10.65,
"result_data": {
"translations": ["Hola", "Adiós", "Gracias"],
"source_language": "en",
"target_language": "es",
"character_count": 22,
"processing_time": 10.65
}
}
Real-Time Progress Tracking
| Field | 설명 |
|---|---|
status |
pending (queued, waiting for a GPU worker), processing (actively translating), completed, failed |
processed_texts |
Number of individual translations completed so far. Updates in real time as each text is translated. |
progress_percentage |
Completion percentage (0-100). Calculated from processed_texts / total_texts. |
queue_position |
Your position in the queue when status is "pending" (1 = next up). Null when processing or completed. Use this to estimate wait time and show queue status to your users. |
processing_time |
Total processing time in seconds (available when completed). |
다중 언어 배치
한 번에 여러 언어로 여러 텍스트를 번역:
{
"texts": ["Hello", "Goodbye"],
"target_languages": ["es", "fr"],
"source_language": "en"
}
완료된 결과 데이터
{
"translations": [
{"es": "Hola", "fr": "Bonjour"},
{"es": "Adiós", "fr": "Au revoir"}
],
"source_language": "en",
"target_languages": ["es", "fr"],
"character_count": 24,
"processing_time": 2.45
}
요청 매개 변수
| 파라미터 | 종류 | 필수 | 설명 |
|---|---|---|---|
texts |
array | 네 | 번역할 문자열 배열 |
target_language |
string | 네* | 단일 언어에 대한 대상 언어 코드 |
target_languages |
array | 네* | 여러 언어를 위한 대상 언어 코드 배열 |
source_language |
string | 아니요 | Source language code. Default: "auto" |
* 둘 중 하나를 제공 target_language 또는 target_languages둘 다 아닙니다.
Best Practices for Large Workloads
- Send 1 target language per batch request. This keeps each batch fast and makes progress easy to track.
- Keep batches at 50-100 texts. Smaller batches complete faster and give you more frequent progress updates.
- Submit as many batch jobs as you need — our GPU cluster auto-scales to handle demand. Jobs are processed in parallel across multiple instances.
- On timeout, re-poll the same job_id instead of submitting a new batch. The original job may still be processing on the GPU.
- Poll every 3-5 seconds. More frequent polling does not speed up processing.
문서 번역
서식을 유지하면서 전체 문서를 번역합니다. 여러 파일 형식 지원.
POST https://api.translateapi.ai/api/v1/translate/document/
요청 (다중 부분/양식 데이터)
| 파라미터 | 종류 | 필수 | 설명 |
|---|---|---|---|
file |
file | 네 | 번역할 문서 (최대 10MB) |
target_language |
string | 네 | Target language code (e.g., "es", "fr", "de") |
source_language |
string | 아니요 | Source language code. Default: "auto" (auto-detect) |
지원되는 파일 형식
Documents
.txt- 일반 텍스트 파일.docx- Word 문서.pdf- PDF 문서(스캔된 문서 포함)
Data & Localization
.json- JSON 파일 (문자열 값 변환).xml- XML 파일.srt- 자막 파일.po/.pot- Gettext 번역 파일
Images (OCR)
.jpg/.jpeg- JPEG 이미지 (OCR).png- PNG 이미지 (OCR).tiff/.tif- TIFF 이미지 (OCR).bmp- BMP 이미지 (OCR).webp- WebP 이미지 (OCR)
예제 (cURL)
# Translate a Word document
curl -X POST https://api.translateapi.ai/api/v1/translate/document/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.docx" \
-F "target_language=es" \
-F "source_language=en"
# Translate text from an image (OCR)
curl -X POST https://api.translateapi.ai/api/v1/translate/document/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@scanned_page.jpg" \
-F "target_language=es" \
-F "source_language=en"
응답
{
"id": 123,
"original_filename": "document.docx",
"file_type": "docx",
"source_language": "en",
"target_language": "es",
"status": "completed",
"character_count": 5420,
"translated_file_url": "/media/translated/document_es.docx",
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:30:05Z"
}
GET https://api.translateapi.ai/api/v1/translate/document/{id}/
문서 번역의 상태를 확인하거나 다운로드 URL을 검색합니다.
상태 값
pending |
파일이 업로드되었으며 처리를 기다리고 있습니다 |
processing |
진행 중인 번역 |
completed |
번역 완료, 다운로드 가능 |
failed |
번역 실패 (check error_message) |
지원되는 언어
지원되는 모든 언어 목록을 확인하십시오.
GET https://api.translateapi.ai/api/v1/translate/languages/
응답
{
"count": 186,
"results": [
{"iso": "en", "name": "English", "en_label": "English"},
{"iso": "es", "name": "Español", "en_label": "Spanish"},
{"iso": "fr", "name": "Français", "en_label": "French"},
...
]
}
Submit Corrections
Suggest a better translation for a given source text. Corrections enter a moderation queue; once approved by our team they surface as "Community Verified" translations for that text.
https://translateapi.ai/api/v1/ (not the api. translation host), and requires an API key.POST https://translateapi.ai/api/v1/suggestions/
요청 본문
| Parameter | 종류 | 설명 |
|---|---|---|
source_text |
string | The original text that was translated. |
source_language |
string | Source language code (e.g. "en"). |
target_language |
string | Target language code (e.g. "es"). |
machine_translation |
string | The machine translation you are correcting. |
suggested_translation |
string | Your improved translation (must differ from machine_translation). |
Example Request
curl -X POST https://translateapi.ai/api/v1/suggestions/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_text": "Hello, world!",
"source_language": "en",
"target_language": "es",
"machine_translation": "Hola, mundo!",
"suggested_translation": "¡Hola, mundo!"
}'
응답
{
"id": 4213,
"status": "pending",
"created": true,
"message": "Correction submitted for review."
}
Re-submitting the same source/language pair updates your existing suggestion instead of creating a duplicate (returns 200 with "created": false).
번역 모델
저희는 자체 GPU 인프라에서 실행되는 최첨단 오픈 소스 번역 모델을 사용합니다. 모든 모델은 상업적으로 라이선스되어 있습니다(아파치 2.0).
| 모델 | 언어 | 가장 적합한 |
|---|---|---|
| Helsinki-NLP/opus-mt | 50개 이상의 언어 쌍 | 일반 언어 (영어, 스페인어, 프랑스어, 독일어, 이탈리아어, 포르투갈어, 러시아어, 중국어, 일본어 등) |
| Google MADLAD-400 | 400개 이상의 언어 지원 | 희귀 언어, 포괄적인 커버리지 |
API는 사용자의 언어 쌍에 가장 적합한 모델을 자동으로 선택합니다. engine 파라미터:
| 엔진 | 설명 |
|---|---|
"auto" |
먼저 HuggingFace를 시도하고, 다시 MADLAD-400으로 돌아갑니다. |
"huggingface" |
강제 HuggingFace/MarianMT (가장 빠른, 50 개 이상의 언어) |
"madlad" |
힘 MADLAD-400 (400 개 이상의 언어) |
오류 처리
API는 성공 또는 실패를 나타내기 위해 표준 HTTP 상태 코드를 사용합니다.
| 코드 | 설명 |
|---|---|
| 200 | 성공 |
| 202 | Accepted — Batch job queued successfully |
| 400 | Bad Request — Invalid parameters (missing text, unsupported language, etc.) |
| 401 | 인증되지 않음 - API 키가 잘못되었거나 누락되었습니다. |
| 402 | Payment Required — Character credits exhausted. Upgrade your plan or purchase a top-up. |
| 403 | Forbidden — API key lacks required scope or IP not in whitelist |
| 503 | 서비스 사용할 수 없습니다 - 번역 엔진 일시적으로 아래로 |
오류 응답 형식
{
"error": "insufficient_credits",
"credits_remaining": 0
}
Usage Limits
TranslateAPI has no request rate limits. All requests are queued and processed by our auto-scaling GPU cluster. Your plan determines your monthly character allowance:
| 계획 | 문자/월 | Batch API | Documents | 가격 | |
|---|---|---|---|---|---|
| 자유 | 250,000 | — | — | $0 | 무료로 가입하기 |
| 스타터 | 2,500,000 | $9/% 1 초 | 구독하기 | ||
| 전문가 | 10,000,000 | $29/% 1 초 | 구독하기 | ||
| 비즈니스 | 40,000,000 | $79/% 1 초 | 구독하기 | ||
| 크기 조정 | 125,000,000 | $199/% 1 초 | 구독하기 | ||
| Enterprise | Unlimited | $499/% 1 초 | Contact Sales |
당신이 당신의 한계를 초과하면, 당신은 402 Payment Required 다음 달까지 응답 또는 업그레이드.
Auto-Scaling Cloud Infrastructure
TranslateAPI runs on dedicated NVIDIA A100 GPU instances with automatic horizontal scaling. When demand increases, additional GPU instances are launched within minutes to maintain fast response times. All requests are queued and processed — send hundreds of concurrent requests and they'll all be handled. Real-time translations get priority, batch jobs process in the background.
Need More Credits?
Run out of characters mid-month? Purchase a one-time credit top-up without changing your plan. View top-up packs