Panimula
Maligayang pagdating sa i18n-agent Translation API! Serbisyo ng pagsasalin na pinapagana ng AI na may pagbabago-ayon sa kultura
Ang dokumentasyon ng API na ito ay nagbibigay ng komprehensibong impormasyon tungkol sa lahat ng available na endpoint, paraan ng pagpapatotoo, format ng kahilingan/tugon, at error code.
Mga Base URL
Kapaligiran | URL |
---|---|
Pagpapaunlad | http://localhost:8000 |
Produksyon | https://api.i18nagent.ai |
Mga Pangunahing Tampok
- 🌐 Suporta sa Maraming Wika - Isalin ang nilalaman sa 10+ wika na may pagbabago-ayon sa kultura
- 🚀 Streaming sa Totoong Oras - Mga Server-Sent Event para sa mga update sa pag-unlad
- 📁 Pagsasalin ng File - Suporta para sa JSON, YAML, XML, CSV, at marami pang iba
- 🔐 Ligtas na Pagpapatotoo - Pagpapatotoo batay sa API key
- 💳 Sistema ng Kredito - Modelo ng pagbabayad ayon sa paggamit
- 🤖 Pinapagana ng AI - Gumagamit ng mga advanced na LLM para sa tumpak na mga pagsasalin
Pagpapatotoo
Upang mag-authenticate, gamitin ang code na ito:
# 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()
}
Siguraduhing palitan ang
i18n_your_api_key_here
ng iyong API key.
Ang i18n-agent API ay gumagamit ng mga API key upang payagan ang access sa API. Maaari mong makuha ang iyong API key mula sa iyong account dashboard.
Ang API key ay dapat isama sa lahat ng kahilingan sa API sa server sa isang header na mukhang ganito:
Authorization: Bearer i18n_your_api_key_here
Mga Endpoint
Impormasyon ng Serbisyo
Kunin ang impormasyon ng serbisyo
GET /
Nagbabalik ng metadata ng serbisyo at available na endpoint
curl -X GET "https://api.i18nagent.ai/" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/', {
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/',
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/", )
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()
}
Ang itaas na command ay nagbabalik ng JSON na nakaayos tulad nito:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2025-09-19T08:57:08.356Z"
}
}
Pagsubaybay
Pagsusuri sa kalusugan
GET /health
Suriin ang katayuan ng kalusugan ng serbisyo
curl -X GET "https://api.i18nagent.ai/health" \
-H "Authorization: Bearer i18n_your_api_key_here" \
-H "Content-Type: application/json"
const response = await fetch('https://api.i18nagent.ai/health', {
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/health',
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/health", )
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()
}
Ang itaas na command ay nagbabalik ng JSON na nakaayos tulad nito:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2025-09-19T08:57:08.357Z"
}
}
Mga Kredito
Kunin ang mga kredito ng koponan
GET /credits
Kunin ang kasalukuyang balanse ng kredito para sa pinatotohanan na koponan
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()
}
Ang itaas na command ay nagbabalik ng JSON na nakaayos tulad nito:
{
"translations": [
{
"original": "Hello, world!",
"translated": "¡Hola, mundo!",
"confidence": 0.98
}
],
"metadata": {
"sourceLanguage": "en",
"targetLanguage": "es",
"wordCount": 2,
"creditsUsed": 0.002,
"timestamp": "2025-09-19T08:57:08.357Z"
}
}
Mga Wika
Listahan ng mga suportadong wika
GET /languages
Kunin ang isang listahan ng lahat ng suportadong wika na may mga rating sa kalidad
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()
}
Ang itaas na utos ay nagbabalik ng JSON na naka-istraktura tulad nito:
code-block id="fmm173"
Pagsasalin
Gumawa ng pagsasalin (pinagsamang)
inline-code id="d56igh"
Pinagsamang endpoint para sa pagsasalin ng teksto at nilalaman ng file
code-block id="z7ug8l"
code-block id="voruq"
code-block id="p4cfr2"
code-block id="1qlapp"
Ang itaas na utos ay nagbabalik ng JSON na naka-istraktura tulad nito:
code-block id="fmm173"
Mga Parameter sa Request Body
Parameter | Uri | Kinakailangan | Paglalarawan |
---|
Gumawa ng pagsasalin na may streaming na pag-unlad
inline-code id="we1zni"
Gumawa ng pagsasalin na may Server-Sent Events (SSE) para sa mga real-time na update sa pag-unlad
code-block id="peluyo"
code-block id="x3s2mb"
code-block id="dgeduz"
code-block id="nm68vk"
Ang itaas na utos ay nagbabalik ng JSON na naka-istraktura tulad nito:
code-block id="fmm173"
Mga Parameter sa Request Body
Parameter | Uri | Kinakailangan | Paglalarawan |
---|---|---|---|
texts | array | Yes | Array of texts to translate |
targetLanguage | string | Yes | Target language code (e.g., 'es', 'fr', 'ja') |
targetAudience | string | No | Target audience (e.g., 'general', 'technical', 'casual', 'formal') (default: general) |
industry | string | No | Industry context (e.g., 'technology', 'healthcare', 'finance') (default: technology) |
sourceLanguage | string | No | Source language code (auto-detected if not provided) |
region | string | No | Specific region for localization (e.g., 'Spain', 'Mexico', 'Brazil') |
context | string | No | Optional additional context or instructions for the translation (e.g., 'Keep technical terms in English', 'Use formal tone', 'Preserve brand names') |
Kumuha ng pagsasalin ng halaga ng pagtatantya
inline-code id="kr5sdi"
Kalkulahin ang bilang ng salita at mga kredito na kailangan para sa pagsasalin
code-block id="vy8r54"
code-block id="n76ul7"
code-block id="xio08t"
code-block id="m6gd2g"
Ang itaas na utos ay nagbabalik ng JSON na naka-istraktura tulad nito:
code-block id="fmm173"
Mga Parameter sa Request Body
Parameter | Uri | Kinakailangan | Paglalarawan |
---|---|---|---|
content | string | Yes | Content to analyze |
fileType | string | No | File type for content analysis (default: txt) |
Pagsusuri
Suriin ang nilalaman para sa paghahanda sa pagsasalin
inline-code id="hnuh5p"
Suriin ang nilalaman upang matukoy ang mga potensyal na isyu at makakuha ng mga mungkahi sa pagpapabuti bago ang pagsasalin. Ang endpoint na ito ay gumagamit ng mga kredito sa parehong rate ng pagsasalin (0.001 kredito kada salita).
code-block id="u7lucf"
code-block id="qcwsho"
code-block id="j71ht8"
code-block id="ihulsh"
Ang itaas na utos ay nagbabalik ng JSON na naka-istraktura tulad nito:
code-block id="fmm173"
Mga Parameter sa Request Body
Parameter | Uri | Kinakailangan | Paglalarawan |
---|---|---|---|
targetLanguage | string | Yes | Target language code for translation |
targetAudience | string | No | Target audience (default: general) |
industry | string | No | Industry context (default: general) |
sourceLanguage | string | No | Source language code (auto-detected if not provided) |
region | string | No | Specific region for localization |
content | object | Yes | Content to analyze (text, array of texts, or structured object) |
fileType | string | No | Optional file type if content is from a file |
mga_trabaho_ng_pagsasalin
kunin_ang_mga_detalye_ng_pagsasalin
3s5ncf
kunin_ang_mga_detalye_ng_isang_tukoy_na_pagsasalin_sa_pamamagitan_ng_id
v4xle1
xmpqu7
dazdu4
w6m08l
ang_nasa_itaas_na_utos_ay_nagbabalik_ng_json_na_naka-istraktura_gaya_nito
fmm173
mga_parameter_ng_query
parameter | kinakailangan | paglalarawan |
---|---|---|
id | Oo | ID_ng_pagsasalin |
--------- | -------- | ----------- |
id | Yes | Translation ID |
kunin_ang_katayuan_ng_pagsasalin
4s30b2
kunin_ang_kasalukuyang_katayuan_ng_isang_trabaho_ng_pagsasalin
3tk9sy
ko649y
am2nln
wrx1oo
ang_nasa_itaas_na_utos_ay_nagbabalik_ng_json_na_naka-istraktura_gaya_nito
fmm173
mga_parameter_ng_query
parameter | kinakailangan | paglalarawan |
---|---|---|
id | Oo | ID_ng_pagsasalin |
--------- | -------- | ----------- |
id | Yes | Translation ID |
i-download_ang_resulta_ng_pagsasalin
gq2ut9
i-download_ang_nagsalin_na_nilalaman
r3bbu5
qaj0v
1r1oa8
vn4al
ang_nasa_itaas_na_utos_ay_nagbabalik_ng_json_na_naka-istraktura_gaya_nito
fmm173
mga_parameter_ng_query
parameter | kinakailangan | paglalarawan |
---|---|---|
id | Oo | ID_ng_pagsasalin |
language | Hindi | code_ng_wika_para_sa_tukoy_na_resulta_ng_wika |
--------- | -------- | ----------- |
id | Yes | Translation ID |
language | No | Language code for specific language result |
i-download_ang_orihinal_na_file
7lv7tb
i-download_ang_orihinal_na_nai-upload_na_file
fcszxb
i8tk2j
7e4g90
u28t4n
ang_nasa_itaas_na_utos_ay_nagbabalik_ng_json_na_naka-istraktura_gaya_nito
fmm173
mga_parameter_ng_query
parameter | kinakailangan | paglalarawan |
---|---|---|
id | Oo | ID_ng_pagsasalin |
--------- | -------- | ----------- |
id | Yes | Translation ID |
ipagpatuloy_ang_pagsasalin_mula_sa_checkpoint
dl3xfb
ipagpatuloy_ang_nabigo_o_napintong_pagsasalin_mula_sa_isang_tukoy_na_checkpoint_o_awtomatikong_mula_sa_huling_matagumpay_na_checkpoint
ltm2px
e153yc
3u70qk
hwbww3
ang_nasa_itaas_na_utos_ay_nagbabalik_ng_json_na_naka-istraktura_gaya_nito
fmm173
mga_parameter_ng_query
parameter | kinakailangan | paglalarawan |
---|---|---|
id | Oo | ID_ng_pagsasalin |
--------- | -------- | ----------- |
id | Yes | Translation ID |
mga_parameter_ng_request_body
Pamamaraan | Uri | Kinakailangan | Paglalarawan |
---|---|---|---|
checkpointId | string | No | Opaque checkpoint ID to resume from (obtained from status endpoint). If not provided and autoDetect is true, will resume from last successful checkpoint. |
continueToEnd | boolean | No | Whether to continue processing all remaining content after resuming (default: true) |
autoDetect | boolean | No | Automatically detect and resume from the last successful checkpoint if checkpointId is not provided (default: true) |
Makakuha ng mga aktibong trabaho sa pagsasalin
yavi3b
Makakuha ng listahan ng mga kasalukuyang aktibong trabaho sa pagsasalin
wiyscn
ab9p4l
rg9c2e
o6634t
Ang itaas na utos ay nagbabalik ng JSON na naka-struktura gaya nito:
fmm173
Mga Kamalian
Ang i18n-agent API ay gumagamit ng mga sumusunod na kodigo ng kamalian:
Kodigo ng Kamalian | Kahulugan |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is invalid. |
402 | Payment Required -- Insufficient credits in your account. |
403 | Forbidden -- Your API key is inactive or team not found. |
404 | Not Found -- The specified resource could not be found. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
Pormat ng Tugon sa Kamalian
xxf6r4