소개
i18n-agent 번역 API에 오신 것을 환영합니다! 문화적 적응을 갖춘 AI 기반 번역 서비스
이 API 문서는 사용 가능한 모든 엔드포인트, 인증 방법, 요청/응답 형식 및 오류 코드에 대한 포괄적인 정보를 제공합니다.
기본 URL
| 환경 | URL |
|---|---|
| 개발 | http://localhost:8000 |
| 프로덕션 | `https://api.i18nagent.크레딧 시스템** - 사용량 기반 가격 모델 |
- 🤖 AI 기반 - 정확한 번역을 위해 고급 LLM 사용
인증
인증하려면 다음 코드를 사용하세요:
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
-H "Authorization: Bearer i18n_your_api_key_here"
const headers = {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
};
fetch('api_endpoint_here', { headers })
.then(response => response.json())
.then(data => console.log(data));
import requests
headers = {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.get('api_endpoint_here', headers=headers)
print(response.json())
package main
import (
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "api_endpoint_here", nil)
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
반드시
i18n_your_api_key_here를 API 키로 대체하세요.
i18n-agent API는 API 키를 사용하여 API 액세스를 허용합니다. 계정 대시보드.)에서 API 키를 얻을 수 있습니다.
API 키는 다음과 같은 헤더로 서버에 대한 모든 API 요청에 포함되어야 합니다:
Authorization: Bearer i18n_your_api_key_here
엔드포인트
크레딧
팀 크레딧 가져오기
GET /credits
인증된 팀의 현재 크레딧 잔액 가져오기
curl -X GET "https://api.i18nagent.ai/credits" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/credits', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/credits',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/credits", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
언어
지원되는 언어 목록
GET /languages
품질 등급이 있는 모든 지원 언어 목록 가져오기
curl -X GET "https://api.i18nagent.ai/languages" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/languages', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/languages',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/languages", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
번역 작업
번역 기록 가져오기
GET /translations
상태, 유형, 대상 언어 및 날짜 범위에 대한 선택적 필터가 있는 번역 작업의 페이지 매김된 목록 가져오기
curl -X GET "https://api.i18nagent.ai/translations" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| page | 아니요 | 페이지 번호 (페이지네이션용) |
| limit | 아니요 | 페이지당 표시 개수 |
| status | 아니요 | 번역 상태로 필터링 |
| type | 아니요 | 번역 유형으로 필터링 |
| targetLanguages | 아니요 | 필터링할 대상 언어 코드의 쉼표로 구분된 목록 |
| fromDate | 아니요 | 이 날짜 이후에 생성된 번역 필터링 |
| toDate | 아니요 | 이 날짜 이전에 생성된 번역 필터링 |
번역 세부 정보 가져오기
GET /translations/{id}
ID로 특정 번역의 세부 정보 가져오기
curl -X GET "https://api.i18nagent.ai/translations/{id}" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{id}', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/{id}',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/{id}", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| id | 예 | 번역 ID |
번역 상태 가져오기
GET /translations/{id}/status
진행률, 경과 시간, 예상 남은 시간, 체크포인트 정보, 다국어 번역의 부분 완료, 완료된 결과에 대한 사전 서명된 다운로드 URL을 포함한 상세 진행 상황 추적을 통해 번역 작업의 실시간 상태를 가져옵니다.
curl -X GET "https://api.i18nagent.ai/translations/{id}/status" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{id}/status', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/{id}/status',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/{id}/status", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| id | 예 | 번역 ID |
번역 결과 다운로드
GET /translations/{id}/result
번역된 콘텐츠를 다운로드합니다.
curl -X GET "https://api.i18nagent.ai/translations/{id}/result" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{id}/result', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/{id}/result',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/{id}/result", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같이 JSON으로 구성됩니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| id | 예 | 번역 ID |
| language | 아니요 | 특정 언어 결과에 대한 언어 코드 |
원본 파일 다운로드
GET /translations/{id}/original
원본 업로드된 파일을 다운로드합니다.
curl -X GET "https://api.i18nagent.ai/translations/{id}/original" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{id}/original', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/{id}/original',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/{id}/original", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같이 JSON으로 구성됩니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| id | 예 | 번역 ID |
체크포인트에서 번역 재개
POST /translations/{id}/resume
실패했거나 중단된 번역을 특정 체크포인트에서 또는 마지막으로 성공한 체크포인트에서 자동으로 재개합니다
curl -X POST "https://api.i18nagent.ai/translations/{id}/resume" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/translations/{id}/resume', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/translations/{id}/resume',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/translations/{id}/resume", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 형식으로 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| id | 예 | 번역 ID |
요청 본문 매개변수
| 매개변수 | 유형 | 필수 | 설명 |
|---|---|---|---|
| checkpointId | string | 아니요 | 재개할 불투명 체크포인트 ID (status endpoint에서 얻음). 제공되지 않고 autoDetect가 true인 경우, 마지막으로 성공한 체크포인트에서 재개됩니다. |
| continueToEnd | boolean | 아니요 | 재개 후 나머지 모든 콘텐츠를 계속 처리할지 여부 (기본값: true) |
| autoDetect | boolean | 아니요 | checkpointId이(가) 제공되지 않으면 마지막으로 성공한 체크포인트에서 자동으로 감지하고 재개합니다 (기본값: true) |
활성 번역 작업 가져오기
GET /translations/jobs/active
현재 활성 번역 작업 목록 가져오기
curl -X GET "https://api.i18nagent.ai/translations/jobs/active" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/jobs/active', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/jobs/active',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/jobs/active", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 형식으로 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
번역 결과 다운로드
POST /translations/{jobId}/download
완료된 번역 결과를 다운로드합니다. 언어별로 정리된 사전 서명된 다운로드 URL을 반환합니다. URL은 24시간 후에 만료됩니다.
curl -X POST "https://api.i18nagent.ai/translations/{jobId}/download" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{jobId}/download', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/translations/{jobId}/download',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/translations/{jobId}/download", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 형식으로 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| jobId | 예 | 번역 작업 ID |
특정 언어용 번역 파일 다운로드
GET /translations/{jobId}/files/{language}
특정 대상 언어용 단일 번역 파일을 다운로드합니다. 적절한 Content-Type 헤더와 함께 파일 콘텐츠를 직접 반환합니다.
curl -X GET "https://api.i18nagent.ai/translations/{jobId}/files/{language}" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/translations/{jobId}/files/{language}', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/translations/{jobId}/files/{language}',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/translations/{jobId}/files/{language}", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같이 JSON 형식으로 구성된 데이터를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| jobId | 예 | 번역 작업 ID |
| language | 예 | 대상 언어 코드 (예: 'es', 'fr', 'ja') |
스트리밍 진행률을 포함한 번역 생성
POST /translations/stream
실시간 진행률 업데이트를 위해 Server-Sent Events (SSE)를 사용하여 번역을 생성합니다. 텍스트 번역만 지원합니다(파일은 제외). SSE 이벤트로 실시간 진행률 업데이트를 반환합니다.
curl -X POST "https://api.i18nagent.ai/translations/stream" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/translations/stream', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/translations/stream',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/translations/stream", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같이 JSON 형식으로 반환합니다.
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
요청 본문 매개변수
| 매개변수 | 유형 | 필수 여부 | 설명 |
|---|---|---|---|
| texts | array | 예 | 번역할 텍스트 배열 |
| targetLanguage | string | 아니요 | targetLanguage 코드 (예: 'es', 'fr', 'ja') - 단일 언어 번역용 |
| targetAudience | string | 아니요 | targetAudience (예: '일반', '기술', '비격식', '격식') (기본값: 일반) |
| industry | string | 아니요 | 산업 분야 (예: '기술', '의료', '금융') (기본값: 기술) |
| sourceLanguage | string | 아니요 | 원본 언어 코드 (제공되지 않은 경우 자동 감지) |
| region | string | 아니요 | 현지화를 위한 특정 지역 (예: '스페인', '멕시코', '브라질') |
| targetLanguages | array | 아니요 | 대상 언어 코드 배열 (예: ['es', 'fr', 'zh-CN']) - 다국어 번역용. targetLanguage와 함께 사용할 수 없습니다. |
| context | string | 아니요 | 번역을 위한 선택적 추가 맥락 또는 지침 (예: '기술 용어는 영어로 유지', '격식체 사용', '브랜드 이름 보존') |
| pseudoTranslation | boolean | 아니요 | AI 번역 없이 i18n 구현을 테스트하고 크레딧 비용이 들지 않는 가상 번역 모드를 활성화합니다. 번역되지 않은 문자열을 식별하고 UI 레이아웃을 테스트하기 위해 악센트, 괄호 및 선택적 CJK 문자로 텍스트를 변환합니다. (기본값: false) |
| pseudoOptions | object | 아니요 | 가상 번역 구성 옵션 (pseudoTranslation이 true일 때만 사용됩니다) |
| skipWarnings | boolean | 아니요 | 원본 텍스트 품질 경고를 건너뛰고 번역을 진행합니다(기본값: false). false일 경우, 문제성 있는 원본 텍스트(예: 번역하기 어려운 구문, 복수화 문제, 텍스트 확장 문제)에 대한 경고가 응답의 'validationSuggestions' 필드 아래에 반환됩니다. true일 경우, 이러한 경고는 더 깔끔한 출력을 위해 억제됩니다. (기본값: false) |
번역 비용 견적 받기
POST /translations/estimate
번역에 필요한 단어 수 및 크레딧을 계산합니다
curl -X POST "https://api.i18nagent.ai/translations/estimate" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/translations/estimate', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/translations/estimate',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/translations/estimate", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 형식으로 반환합니다.
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
요청 본문 매개변수들
| 매개변수 | 유형 | 필수 | 설명 |
|---|---|---|---|
| content | string | 예 | 분석할 콘텐츠 |
| fileType | string | 아니요 | 콘텐츠 분석용 파일 유형 (기본값: txt) |
분석
번역 준비 상태를 위한 콘텐츠 분석
POST /analyze
번역 전 잠재적 문제를 식별하기 위한 소스 텍스트의 경량 유효성 검사. 프로그래밍 방식 액세스를 위한 오류 코드와 함께 유효성 검사 결과를 반환합니다. 이 엔드포인트는 크레딧을 소비하지 않습니다 - AI/LLM 호출 없이 빠른 결정론적 유효성 검사를 실행합니다.
curl -X POST "https://api.i18nagent.ai/analyze" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/analyze', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/analyze',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/analyze", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같이 JSON으로 구조화된 데이터를 반환합니다.
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
요청 본문 파라미터
| 파라미터 | 유형 | 필수 | 설명 |
|---|---|---|---|
| targetLanguage | string | 예 | 번역용 대상 언어 코드 |
| targetAudience | string | 아니요 | 대상 독자 (기본값: 일반) |
| industry | string | 아니요 | 산업 컨텍스트 (기본값: 일반) |
| sourceLanguage | string | 아니요 | 소스 언어 코드 (제공되지 않으면 자동 감지됨) |
| region | string | 아니요 | 현지화를 위한 특정 지역 |
| content | object | 예 | 분석할 콘텐츠 (텍스트, 텍스트 배열 또는 구조화된 객체) |
| fileType | string | 아니요 | 콘텐츠가 파일에서 온 경우 선택적 파일 유형 |
네임스페이스 번역
네임스페이스 재사용을 위한 번역 파일 업로드
POST /namespaces/{namespace}/translations/upload
기존 번역 파일을 네임스페이스에 업로드하여 향후 재사용하세요. 이를 통해 이전에 번역된 문자열을 재사용하여 비용 최적화를 할 수 있습니다. 파일이 처리되고 번역 쌍이 캐싱을 위해 추출됩니다.
curl -X POST "https://api.i18nagent.ai/namespaces/{namespace}/translations/upload" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/namespaces/{namespace}/translations/upload', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/namespaces/{namespace}/translations/upload',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/namespaces/{namespace}/translations/upload", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령은 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| namespace | 예 | 네임스페이스 식별자 (3-50자, 영숫자 + 하이픈/밑줄만 사용) |
네임스페이스 번역 통계 가져오기
GET /namespaces/{namespace}/translations/stats
네임스페이스에 대한 업로드된 번역 파일 및 캐시 재사용 통계 가져오기
curl -X GET "https://api.i18nagent.ai/namespaces/{namespace}/translations/stats" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/namespaces/{namespace}/translations/stats', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/namespaces/{namespace}/translations/stats',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/namespaces/{namespace}/translations/stats", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 형식으로 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| namespace | 예 | 네임스페이스 식별자 |
네임스페이스의 업로드된 번역 파일 목록
GET /namespaces/{namespace}/translations/files
네임스페이스에 대한 업로드된 번역 파일의 페이지 매김된 목록 가져오기
curl -X GET "https://api.i18nagent.ai/namespaces/{namespace}/translations/files" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/namespaces/{namespace}/translations/files', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/namespaces/{namespace}/translations/files',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/namespaces/{namespace}/translations/files", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| namespace | 예 | 네임스페이스 식별자 |
| limit | 아니요 | 반환할 최대 파일 수 |
| offset | 아니요 | 페이지네이션을 위해 건너뛸 파일 수 |
업로드된 번역 파일 삭제
DELETE /namespaces/{namespace}/translations/files/{fileId}
캐시에서 업로드된 번역 파일 및 모든 관련 번역 쌍을 삭제합니다.
curl -X DELETE "https://api.i18nagent.ai/namespaces/{namespace}/translations/files/{fileId}" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/namespaces/{namespace}/translations/files/{fileId}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.delete(
'https://api.i18nagent.ai/namespaces/{namespace}/translations/files/{fileId}',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("DELETE", "https://api.i18nagent.ai/namespaces/{namespace}/translations/files/{fileId}", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 구조를 반환합니다:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 매개변수
| 매개변수 | 필수 | 설명 |
|---|---|---|
| namespace | 예 | 네임스페이스 식별자 |
| fileId | 예 | 삭제할 파일 ID |
병렬 번역 파일 업로드
POST /translations/upload-parallel
번역 쌍 추출 및 캐싱을 위해 소스 및 타겟 파일을 병렬로 업로드합니다. 두 파일 모두 동일한 구조와 파일 유형을 가져야 합니다.
curl -X POST "https://api.i18nagent.ai/translations/upload-parallel" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}'
const response = await fetch('https://api.i18nagent.ai/translations/upload-parallel', {
method: 'POST',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
})
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.i18nagent.ai/translations/upload-parallel',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
},
json={
"texts": [
"Hello, world!",
"Welcome to our service"
],
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
"sourceLanguage": "en",
"region": "Mexico",
"notes": "Keep technical terms in English, use formal tone"
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
data := map[string]interface{}{
"texts": []string{"Hello, world!", "Welcome to our service"},
"targetLanguage": "es",
"targetAudience": "general",
"industry": "technology",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.i18nagent.ai/translations/upload-parallel", bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 형식으로 반환됩니다.
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
파일들
스토리지에서 파일 다운로드
GET /files/{filePath}
로컬 스토리지(개발) 또는 S3(프로덕션)에서 파일을 제공합니다. 업로드된 파일 및 번역된 파일에 액세스하는 데 사용됩니다.
curl -X GET "https://api.i18nagent.ai/files/{filePath}" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/files/{filePath}', {
method: 'GET',
headers: {
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.get(
'https://api.i18nagent.ai/files/{filePath}',
headers={
'Authorization': 'Bearer i18n_your_api_key_here',
'Content-Type': 'application/json'
}
)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.i18nagent.ai/files/{filePath}", )
req.Header.Add("Authorization", "Bearer i18n_your_api_key_here")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
}
위 명령어는 다음과 같은 JSON 형식으로 반환됩니다.
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
쿼리 파라미터
| 파라미터 | 필수 | 설명 |
|---|---|---|
| filePath | 예 | 하위 디렉터리를 포함한 파일 경로 (예: 'uploads/test-file.json' 또는 'translations/result.json') |
오류
i18n-agent API는 다음 오류 코드를 사용합니다:
| 오류 코드 | 의미 |
|---|---|
| 400 | 잘못된 요청 -- 요청이 유효하지 않습니다. |
| 401 | 권한 없음 -- API key가 유효하지 않습니다. |
| 402 | 결제 필요 -- 계정에 크레딧이 부족합니다. |
| 403 | 금지됨 -- API key가 비활성화되었거나 팀을 찾을 수 없습니다. |
| 404 | 찾을 수 없음 -- 지정된 리소스를 찾을 수 없습니다. |
| 500 | 내부 서버 오류 -- 서버에 문제가 발생했습니다. 나중에 다시 시도하세요. |
| 503 | 서비스를 사용할 수 없음 -- 유지보수를 위해 일시적으로 오프라인 상태입니다. 나중에 다시 시도하세요. |
오류 응답 형식
{
"error": "Detailed error message describing what went wrong",
"success": false
}