परिचय
i18n-एजेंट अनुवाद API में आपका स्वागत है! सांस्कृतिक अनुकूलन के साथ AI-संचालित अनुवाद सेवा
यह API दस्तावेज़ सभी उपलब्ध एंडपॉइंट्स, प्रमाणीकरण विधियों, अनुरोध/प्रतिक्रिया प्रारूपों और त्रुटि कोड के बारे में व्यापक जानकारी प्रदान करता है।
आधार URL
| वातावरण | URL |
|---|---|
| विकास | http://localhost:8000 |
| उत्पादन | https://api.i18nagent.ai |
मुख्य विशेषताएं
- 🌐 बहु-भाषा समर्थन - 10+ भाषाओं में सामग्री का सांस्कृतिक अनुकूलन के साथ अनुवाद
- 🚀 रीयल-टाइम स्ट्रीमिंग - प्रगति अपडेट के लिए सर्वर-भेजा गया घटना
- 📁 फ़ाइल अनुवाद - JSON, YAML, XML, CSV और अधिक के लिए समर्थन
- 🔐 सुरक्षित प्रमाणीकरण - API कुंजी-आधारित प्रमाणीकरण
- 💳 क्रेडिट प्रणाली - पे-एज-यू-गो मूल्य निर्धारण मॉडल
- 🤖 एआई-संचालित - सटीक अनुवादों के लिए उन्नत एलएलएम का उपयोग करता है
प्रमाणीकरण
प्रमाणीकरण के लिए, इस कोड का उपयोग करें:
# 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 संरचित करता है:
{
"success": true,
"data": {
"teamId": "team_123",
"teamName": "My Team",
"credits": 125.5,
"userId": "user_456"
},
"metadata": {
"timestamp": "2024-01-15T12:00:00.000Z"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| data | object | |
| data.teamId | string | Team identifier |
| data.teamName | string | Team name |
| data.credits | number | Current credit balance |
| data.userId | string | User identifier |
| metadata | object | |
| metadata.timestamp | string | Response timestamp |
भाषाएँ
समर्थित भाषाओं की सूची
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 संरचित करता है:
{
"languages": [
{
"code": "es",
"name": "Spanish",
"quality": "high"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
| languages | array |
अनुवाद कार्य
अनुवाद इतिहास प्राप्त करें
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": [
{
"id": "translation_job_id",
"type": "TEXT",
"fileName": "file_name_(for_file_translations)",
"fileType": "file_type_(for_file_translations)",
"targetLanguages": [
"string"
],
"status": "PENDING",
"progress": 0,
"wordCount": 0,
"creditsRequired": 0,
"createdAt": "2024-01-15T12:00:00.000Z",
"startedAt": "2024-01-15T12:00:00.000Z",
"completedAt": "2024-01-15T12:00:00.000Z",
"user": {}
}
],
"pagination": {
"page": 0,
"limit": 0,
"total": 0,
"totalPages": 0
}
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| page | No | Page number for pagination |
| limit | No | Number of items per page |
| status | No | Filter by translation status |
| type | No | Filter by translation type |
| targetLanguages | No | Comma-separated list of target language codes to filter by |
| fromDate | No | Filter translations created after this date |
| toDate | No | Filter translations created before this date |
Response Fields
| Field | Type | Description |
|---|---|---|
| translations | array | |
| pagination | object | |
| pagination.page | integer | |
| pagination.limit | integer | |
| pagination.total | integer | |
| pagination.totalPages | integer |
अनुवाद विवरण प्राप्त करें
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 लौटाता है:
{
"id": "translation_job_id",
"type": "TEXT",
"fileName": "original_file_name_(for_file_translations)",
"fileType": "file_type_(json,_yaml,_etc",
"fileSize": 0,
"targetLanguages": [
"string"
],
"context": "translation_context_or_instructions",
"wordCount": 0,
"creditsRequired": 0,
"status": "PENDING",
"progress": 0,
"errorMessage": "error_message_if_translation_failed",
"translatedFiles": {},
"createdAt": "2024-01-15T12:00:00.000Z",
"startedAt": "2024-01-15T12:00:00.000Z",
"completedAt": "2024-01-15T12:00:00.000Z",
"user": {}
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| id | Yes | Translation ID |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Translation job ID |
| type | string | Type of translation job |
| fileName | string | Original file name (for file translations) |
| fileType | string | File type (json, yaml, etc.) |
| fileSize | integer | File size in bytes |
| targetLanguages | array | Target languages for translation |
| context | string | Translation context or instructions |
| wordCount | integer | Number of words in source content |
| creditsRequired | number | Credits required for this translation |
| status | string | Current status of the translation |
| progress | integer | Progress percentage (0-100) |
| errorMessage | string | Error message if translation failed |
| translatedFiles | object | Translated file data (when completed) |
| createdAt | string | When the job was created |
| startedAt | string | When processing started |
| completedAt | string | When the job was completed |
| user | object | User who created the translation |
अनुवाद स्थिति प्राप्त करें
GET /translations/{id}/status
अनुवाद कार्य की वास्तविक समय की स्थिति को विस्तृत प्रगति ट्रैकिंग के साथ प्राप्त करें जिसमें शामिल हैं: प्रगति प्रतिशत, बीता समय, अनुमानित शेष समय, चेकपॉइंट जानकारी, बहु-भाषा अनुवादों के लिए आंशिक पूर्णता, और पूर्ण परिणामों के लिए प्रीसाइन्ड डाउनलोड यूआरएल।
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 संरचित करता है:
{
"id": "translation_job_id",
"status": "PENDING",
"statusText": "localized_human-readable_status_message",
"progress": 0,
"elapsedTime": "120 seconds",
"estimatedTimeRemaining": "45 seconds",
"message": "Translation in progress... 65% complete",
"chunks": {
"completed": 0,
"total": 0
},
"lastCheckpointId": "opaque_checkpoint_id_for_the_last_saved_checkpoint_(can_be_used_to_resume)",
"checkpointDescription": "Localization (65% complete, chunk 60%)",
"completedLanguages": [
"es",
"fr",
"de"
],
"partialCompletionMessage": "3 language(s) completed: es, fr, de",
"downloadUrls": {},
"createdAt": "2024-01-15T12:00:00.000Z",
"startedAt": "2024-01-15T12:00:00.000Z",
"completedAt": "2024-01-15T12:00:00.000Z",
"metadata": {},
"result": {},
"error": "error_message_(only_when_failed)"
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| id | Yes | Translation ID |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Translation job ID |
| status | string | Current status |
| statusText | string | Localized human-readable status message |
| progress | integer | Progress percentage (0-100) |
| elapsedTime | string | Time elapsed since job started processing |
| estimatedTimeRemaining | string | Estimated time remaining for completion |
| message | string | Status message or error details |
| chunks | object | Batch/chunk processing progress (for large translations) |
| chunks.completed | integer | Number of chunks completed |
| chunks.total | integer | Total number of chunks |
| lastCheckpointId | string | Opaque checkpoint ID for the last saved checkpoint (can be used to resume) |
| checkpointDescription | string | Human-readable description of current checkpoint progress |
| completedLanguages | array | Array of language codes that have been completed (for multi-language translations with partial completion) |
| partialCompletionMessage | string | Message describing partial completion status |
| downloadUrls | object | Presigned download URLs for completed translations, organized by language code. Example: {"es": "https://...", "fr": "https://..."}. URLs expire after 1 hour. This is the primary method for accessing completed translation files. |
| createdAt | string | When the job was created |
| startedAt | string | When the job started processing |
| completedAt | string | When the job was completed |
| metadata | object | Additional metadata about the translation |
| result | object | Translation result (only when completed) |
| error | string | Error message (only when failed) |
अनुवाद परिणाम डाउनलोड करें
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 | Yes | Translation ID |
| language | No | Language code for specific language result |
मूल फ़ाइल डाउनलोड करें
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 | Yes | Translation 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 संरचित करता है:
{
"success": true,
"message": "Translation resume initiated",
"id": "translation_job_id",
"checkpointId": "the_checkpoint_id_from_which_the_translation_is_resuming",
"description": "Resuming from last checkpoint",
"status": "PROCESSING"
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| id | Yes | Translation ID |
अनुरोध बॉडी पैरामीटर
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
| 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) |
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the resume was successfully initiated |
| message | string | Status message |
| id | string | Translation job ID |
| checkpointId | string | The checkpoint ID from which the translation is resuming |
| description | string | Human-readable description of the resume action |
| status | string | Current status of the translation after resuming |
सक्रिय अनुवाद कार्य प्राप्त करें
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 संरचित करता है:
{
"activeJobs": [
{
"id": "string",
"type": "FILE",
"fileName": "string",
"fileType": "string",
"text": "string",
"targetLanguages": [
"string"
],
"status": "PENDING",
"progress": 0,
"wordCount": 0,
"creditsRequired": 0,
"createdAt": "string",
"startedAt": "string",
"originalPreview": "string",
"user": {
"id": "string",
"name": "string",
"email": "string"
}
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
| activeJobs | array |
अनुवाद परिणाम डाउनलोड करें
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 संरचित करता है:
{
"jobId": "translation_job_id",
"fileName": "original_file_name",
"targetLanguages": [
"string"
],
"requestedLanguages": [
"string"
],
"downloadUrls": {},
"message": "Translation files ready for download. Use downloadUrls to access each language file.",
"expiresIn": "24 hours",
"partialFailure": true,
"failedLanguages": [
"string"
],
"errorMessage": "error_message_for_failed_languages",
"warning": "Translation completed partially. 2 of 5 language(s) failed: ja, zh-CN"
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| jobId | Yes | Translation job ID |
Response Fields
| Field | Type | Description |
|---|---|---|
| jobId | string | Translation job ID |
| fileName | string | Original file name |
| targetLanguages | array | Completed target languages available for download |
| requestedLanguages | array | Originally requested target languages |
| downloadUrls | object | Presigned download URLs organized by language code. Example: {"es": {"url": "https://...", "key": "..."}, "fr": {"url": "https://...", "key": "..."}} |
| message | string | Status or information message |
| expiresIn | string | Expiration time for download URLs |
| partialFailure | boolean | Indicates if some languages failed to translate |
| failedLanguages | array | Language codes that failed to translate |
| errorMessage | string | Error message for failed languages |
| warning | string | Warning message about partial completion |
विशिष्ट भाषा के लिए अनुवाद फ़ाइल डाउनलोड करें
GET /translations/{jobId}/files/{language}
किसी विशिष्ट लक्ष्य भाषा के लिए एक अनुवाद फ़ाइल डाउनलोड करें। उचित कंटेंट-टाइप हेडर के साथ सीधे फ़ाइल सामग्री को वापस करता है।
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 संरचित करके वापस करता है:
"string"
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| jobId | Yes | Translation job ID |
| language | Yes | Target language code (e.g., 'es', 'fr', 'ja') |
स्ट्रीमिंग प्रगति के साथ अनुवाद बनाएं
POST /translations/stream
वास्तविक समय की प्रगति अपडेट के लिए सर्वर-सेंट इवेंट्स (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 | Yes | Array of texts to translate |
| targetLanguage | string | No | Target language code (e.g., 'es', 'fr', 'ja') - for single language translation |
| 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') |
| targetLanguages | array | No | Array of target language codes (e.g., ['es', 'fr', 'zh-CN']) - for multi-language translation. Cannot be used together with targetLanguage. |
| context | string | No | Optional additional context or instructions for the translation (e.g., 'Keep technical terms in English', 'Use formal tone', 'Preserve brand names') |
| pseudoTranslation | boolean | No | Enable pseudo-translation mode for testing i18n implementations without AI translation and NO credit cost. Transforms text with accents, brackets, and optional CJK characters to identify untranslated strings and test UI layout. (default: false) |
| pseudoOptions | object | No | Configuration options for pseudo-translation (only used when pseudoTranslation is true) |
| skipWarnings | boolean | No | Skip source text quality warnings and proceed with translation (default: false). When false, warnings about problematic source text (e.g., hard-to-translate phrases, pluralization issues, text expansion concerns) will be returned in the response under 'validationSuggestions' field. When true, these warnings are suppressed for cleaner output. (default: 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 संरचित करके वापस करता है:
{
"wordCount": 0,
"creditsRequired": 0,
"fileType": "txt",
"estimatedCostUSD": 0
}
अनुरोध बॉडी पैरामीटर
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
| content | string | Yes | Content to analyze |
| fileType | string | No | File type for content analysis (default: txt) |
Response Fields
| Field | Type | Description |
|---|---|---|
| wordCount | integer | Number of words in the content |
| creditsRequired | number | Credits required for translation |
| fileType | string | File type used for analysis |
| estimatedCostUSD | number | Estimated cost in USD |
विश्लेषण
Validate source text for translation readiness
POST /analyze
Lightweight validation of source text to identify potential issues before translation. Returns validation results with error codes for programmatic access. This endpoint does NOT consume credits - it runs fast, deterministic validation without AI/LLM calls.
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()
}
The above command returns JSON structured like this:
{
"success": true,
"isValid": true,
"hasWarnings": true,
"wordCount": 0,
"issues": [
{
"code": "EMPTY_CONTENT",
"severity": "info",
"message": "human-readable_description_of_the_issue",
"suggestion": "suggested_fix_for_the_issue",
"affectedCount": 0,
"examples": [
"string"
]
}
],
"totalIssues": 0,
"summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"errorCodes": {
"EMPTY_CONTENT": "string",
"ENCODING_ISSUES": "string",
"UNCLOSED_PLACEHOLDER": "string",
"NESTED_PLACEHOLDERS": "string",
"INCONSISTENT_PLACEHOLDER_FORMAT": "string",
"HARDCODED_PLURALS": "string",
"VERY_LONG_STRINGS": "string",
"INVISIBLE_CHARACTERS": "string",
"EMPTY_JSON_VALUES": "string",
"INVALID_JSON": "string",
"HARDCODED_VALUES": "string"
}
}
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | Content to validate (text or JSON string) |
| fileType | string | No | File type hint for validation (auto-detected if not provided) (default: auto) |
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether validation completed (same as isValid) |
| isValid | boolean | Whether content passed validation (no errors) |
| hasWarnings | boolean | Whether content has warnings (but no blocking errors) |
| wordCount | integer | Number of words in the content |
| issues | array | List of validation issues found |
| totalIssues | integer | Total number of issues found |
| summary | object | Summary counts by severity |
| summary.errors | integer | Number of error-level issues |
| summary.warnings | integer | Number of warning-level issues |
| summary.info | integer | Number of info-level issues |
| errorCodes | object | Reference enum of all possible error codes for programmatic access |
| errorCodes.EMPTY_CONTENT | string | |
| errorCodes.ENCODING_ISSUES | string | |
| errorCodes.UNCLOSED_PLACEHOLDER | string | |
| errorCodes.NESTED_PLACEHOLDERS | string | |
| errorCodes.INCONSISTENT_PLACEHOLDER_FORMAT | string | |
| errorCodes.HARDCODED_PLURALS | string | |
| errorCodes.VERY_LONG_STRINGS | string | |
| errorCodes.INVISIBLE_CHARACTERS | string | |
| errorCodes.EMPTY_JSON_VALUES | string | |
| errorCodes.INVALID_JSON | string | |
| errorCodes.HARDCODED_VALUES | string |
Namespace Translations
नेमस्पेस पुन: उपयोग के लिए अनुवाद फ़ाइल अपलोड करें
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 संरचना जैसा दिखता है:
{
"success": true,
"fileId": "string",
"pairsStored": 0,
"pairsUpdated": 0,
"message": "string"
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| namespace | Yes | Namespace identifier (3-50 chars, alphanumeric + hyphens/underscores only) |
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | |
| fileId | string | |
| pairsStored | integer | Number of new translation pairs stored |
| pairsUpdated | integer | Number of existing translation pairs updated |
| message | string |
नेमस्पेस अनुवाद के आँकड़े प्राप्त करें
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 संरचित डेटा देता है:
{
"namespaceId": "string",
"namespaceName": "string",
"totalFiles": 0,
"files": [
{
"id": "string",
"baseFileName": "string",
"sourceLocale": "string",
"targetLocale": "string",
"pairsExtracted": 0,
"createdAt": "2024-01-15T12:00:00.000Z"
}
],
"cacheStatistics": [
{
"sourceLocale": "string",
"targetLocale": "string",
"pairCount": 0,
"totalReuses": 0
}
]
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| namespace | Yes | Namespace identifier |
Response Fields
| Field | Type | Description |
|---|---|---|
| namespaceId | string | |
| namespaceName | string | |
| totalFiles | integer | |
| files | array | |
| cacheStatistics | array |
नेमस्पेस में अपलोड की गई अनुवाद फ़ाइलों को सूचीबद्ध करें
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 लौटाता है:
{
"namespaceId": "string",
"namespaceName": "string",
"totalFiles": 0,
"limit": 0,
"offset": 0,
"files": [
{
"id": "string",
"baseFileName": "string",
"originalFileName": "string",
"fileType": "string",
"fileSize": 0,
"sourceLocale": "string",
"targetLocale": "string",
"pairsExtracted": 0,
"status": "string",
"uploadedBy": "string",
"createdAt": "2024-01-15T12:00:00.000Z",
"updatedAt": "2024-01-15T12:00:00.000Z"
}
]
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| namespace | Yes | Namespace identifier |
| limit | No | Maximum number of files to return |
| offset | No | Number of files to skip for pagination |
Response Fields
| Field | Type | Description |
|---|---|---|
| namespaceId | string | |
| namespaceName | string | |
| totalFiles | integer | |
| limit | integer | |
| offset | integer | |
| files | array |
अपलोड की गई अनुवाद फ़ाइल हटाएँ
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 लौटाता है:
{
"success": true,
"fileName": "string",
"pairsDeleted": 0,
"message": "string"
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| namespace | Yes | Namespace identifier |
| fileId | Yes | File ID to delete |
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | |
| fileName | string | |
| pairsDeleted | integer | |
| message | string |
समानांतर अनुवाद फ़ाइलें अपलोड करें
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 को वापस करता है:
{
"success": true,
"fileId": "string",
"pairsStored": 0,
"pairsUpdated": 0,
"message": "string"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | |
| fileId | string | |
| pairsStored | integer | Number of new translation pairs stored |
| pairsUpdated | integer | Number of existing translation pairs updated |
| message | string |
फ़ाइलें
स्टोरेज से फ़ाइल डाउनलोड करें
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 को वापस करता है:
{
"error": "Detailed error message describing what went wrong",
"success": false
}
क्वेरी पैरामीटर
| पैरामीटर | आवश्यक | विवरण |
|---|---|---|
| filePath | Yes | File path including any subdirectories (e.g., 'uploads/test-file.json' or 'translations/result.json') |
त्रुटियाँ
i18n-एजेंट API निम्नलिखित त्रुटि कोड का उपयोग करता है:
| त्रुटि कोड | अर्थ |
|---|---|
| 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. |
त्रुटि प्रतिक्रिया प्रारूप
{
"error": "Detailed error message describing what went wrong",
"success": false
}
अनुवाद की तत्परता के लिए सामग्री का विश्लेषण करें
POST /analyze
अनुवाद से पहले संभावित समस्याओं की पहचान के लिए स्रोत पाठ का हल्का सत्यापन। प्रोग्रामेटिक एक्सेस के लिए त्रुटि कोड के साथ सत्यापन परिणाम लौटाता है। यह endpoint क्रेडिट का उपभोग नहीं करता - यह 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 | नहीं | यदि सामग्री फ़ाइल से है तो वैकल्पिक फ़ाइल प्रकार |