Inleiding
Welkom bij de i18n-agent Vertaal-API! AI-aangedreven vertaaldienst met culturele aanpassing
Deze API-documentatie biedt uitgebreide informatie over alle beschikbare eindpunten, authenticatiemethoden, verzoek-/responsformaten en foutcodes.
Basis URLs
| Omgeving | URL |
|---|---|
| Ontwikkeling | http://localhost:8000 |
| Productie | https://api.i18nagent.ai |
Belangrijkste functies
- 🌐 Ondersteuning voor meerdere talen - Vertaal inhoud naar 10+ talen met culturele aanpassing
- 🚀 Realtime streaming - ServerSent Events voor voortgangsupdates
- 📁 Bestandsvertaling - Ondersteuning voor JSON, YAML, XML, CSV en meer
- 🔐 Veilige authenticatie - API-sleutelgebaseerde authenticatie
- 💳 Kredietsysteem - Pay-as-you-go prijsmodel
- 🤖 AI-aangedreven - Gebruikt geavanceerde LLM's voor nauwkeurige vertalingen
Authenticatie
Gebruik deze code om te authenticeren:
# 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()
}
Zorg ervoor dat u
i18n_your_api_key_herevervangt door uw API-sleutel.
De i18n-agent API gebruikt API-sleutels om toegang tot de API toe te staan. U kunt uw API-sleutel verkrijgen via uw accountdashboard.
De API-sleutel moet in alle API-verzoeken naar de server worden opgenomen in een header die er als volgt uitziet:
Authorization: Bearer i18n_your_api_key_here
Eindpunten
Tegoeden
Teamtegoeden ophalen
GET /credits
Haal het huidige kredietbalans op voor het geauthenticeerde team
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()
}
Het bovenstaande commando retourneert JSON gestructureerd als volgt:
{
"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"
}
}
Talen
Lijst ondersteunde talen
GET /languages
Haal een lijst op van alle ondersteunde talen met kwaliteitsbeoordelingen
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()
}
Het bovenstaande commando retourneert JSON gestructureerd als volgt:
{
"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"
}
}
Vertaalopdrachten
Haal vertaalgeschiedenis op
GET /translations
Haal een gepagineerde lijst van vertaalopdrachten op met optionele filters voor status, type, doeltalen en datumbereik
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()
}
Het bovenstaande commando retourneert JSON gestructureerd als volgt:
{
"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"
}
}
Queryparameters
| Parameter | Vereist | Beschrijving |
|---|---|---|
| page | Nee | Paginanummer voor paginering |
| limit | Nee | Aantal items per pagina |
| status | Nee | Filteren op vertaalstatus |
| type | Nee | Filteren op vertaaltype |
| targetLanguages | Nee | Door komma's gescheiden lijst van doeltaalcodes om op te filteren |
| fromDate | Nee | Filter vertalingen gemaakt na deze datum |
| toDate | Nee | Filter vertalingen gemaakt voor deze datum |
Vertaaldetails ophalen
GET /translations/{id}
Haal details op van een specifieke vertaling op basis van 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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| id | Ja | Vertaal-ID |
Vertaalstatus ophalen
GET /translations/{id}/status
Verkrijg real-time status van een vertaalopdracht met gedetailleerde voortgangscontrole, inclusief: voortgangspercentage, verstreken tijd, geschatte resterende tijd, controlepuntinformatie, gedeeltelijke voltooiing voor meertalige vertalingen en vooraf ondertekende download URLs voor voltooide resultaten.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| id | Ja | Vertaal-ID |
Vertaalresultaat downloaden
GET /translations/{id}/result
Download de vertaalde inhoud
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| id | Ja | Vertaal-ID |
| language | Nee | Taalcode voor specifiek taalresultaat |
Oorspronkelijk bestand downloaden
GET /translations/{id}/original
Download het oorspronkelijke geüploade bestand
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| id | Ja | Vertaal-ID |
Vertaal hervatten vanuit controlepunt
POST /translations/{id}/resume
Hervat een mislukte of onderbroken vertaling vanuit een specifiek controlepunt of automatisch vanuit het laatste succesvolle controlepunt
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| id | Ja | Vertaal-ID |
Aanvraagbodyparameters
| Parameter | Type | Verplicht | Beschrijving |
|---|---|---|---|
| checkpointId | string | Nee | Ondoorzichtig controlepunt-ID om van te hervatten (verkregen van status-eindpunt). Indien niet opgegeven en autoDetect waar is, wordt hervat vanuit laatste succesvolle controlepunt. |
| continueToEnd | boolean | Nee | Of alle resterende inhoud moet worden verwerkt na hervatten (standaard: waar) |
| autoDetect | boolean | Nee | Automatisch detecteren en hervatten vanaf het laatste succesvolle controlepunt als checkpointId niet wordt opgegeven (standaard: waar) |
Actieve vertalingsopdrachten ophalen
GET /translations/jobs/active
Lijst ophalen van momenteel actieve vertalingsopdrachten
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Vertaalresultaten downloaden
POST /translations/{jobId}/download
Voltooide vertaalresultaten downloaden. Retourneert vooraf ondertekende download URLs georganiseerd per taal. URLs vervalt na 24 uur.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Vereist | Beschrijving |
|---|---|---|
| jobId | Ja | Vertaal-taak-ID |
Downloadvertaalbestand voor specifieke taal
GET /translations/{jobId}/files/{language}
Download een enkel vertaalbestand voor een specifieke doeltaal. Retourneert de bestandsinhoud direct met de juiste Content-Type-header.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Zoekopdracht Parameters
| Parameter | Vereist | Beschrijving |
|---|---|---|
| jobId | Ja | Vertaal-taak-ID |
| language | Ja | Doeltaalcode (bijv. 'es', 'fr', 'ja') |
Maak vertaling met streaming voortgang
POST /translations/stream
Maak een vertaling met Server-Sent Events (SSE) voor real-time voortgangsupdates. Ondersteunt alleen tekstvertaling (geen bestanden). Retourneert real-time voortgangsupdates als SSE-events.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Aanvraag Body Parameters
| Parameter | Type | Vereist | Beschrijving |
|---|---|---|---|
| texts | array | Ja | Array van teksten om te vertalen |
| targetLanguage | string | Nee | Doeltaalcode (bijv. 'es', 'fr', 'ja') - voor vertaling naar één taal |
| targetAudience | string | Nee | Doelgroep (bijv. 'general', 'technical', 'casual', 'formal') (standaard: general) |
| industry | string | Nee | Industriecontext (bijv. 'technologie', 'gezondheidszorg', 'financiën') (standaard: technologie) |
| sourceLanguage | string | Nee | Brontaalcode (automatisch gedetecteerd indien niet opgegeven) |
| region | string | Nee | Specifieke regio voor lokalisatie (bijv. 'Spanje', 'Mexico', 'Brazilië') |
| targetLanguages | array | Nee | Array van doeltaalcodes (bijv. ['es', 'fr', 'zh-CN']) - voor meertalige vertaling. Kan niet samen worden gebruikt met targetLanguage. |
| context | string | Nee | Optionele aanvullende context of instructies voor de vertaling (bijv. 'Technische termen in het Engels houden', 'Formele toon gebruiken', 'Merknamen behouden') |
| pseudoTranslation | boolean | Nee | Pseudo-vertaalmodus inschakelen voor het testen van i18n-implementaties zonder AI-vertaling en GEEN kredietkosten. Transformeert tekst met accenten, haken en optionele CJK-tekens om niet-vertaalde strings te identificeren en UI-lay-out te testen. (standaard: false) |
| pseudoOptions | object | Nee | Configuratie-opties voor pseudo-vertaling (alleen gebruikt wanneer pseudoTranslation waar is) |
| skipWarnings | boolean | Nee | Sla waarschuwingen over brontekst kwaliteit over en ga door met vertaling (standaard: false). Wanneer false, zullen waarschuwingen over problematische brontekst (bijv. moeilijk te vertalen zinsneden, meervoudsproblemen, tekstuitbreidingszorgen) worden geretourneerd in het antwoord onder het 'validationSuggestions' veld. Wanneer true, worden deze waarschuwingen onderdrukt voor een schonere uitvoer. (standaard: false) |
Vraag kostenraming voor vertaling
POST /translations/estimate
Bereken woordenaantal en benodigde credits voor vertaling
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Aanvraag Body Parameters
| Parameter | Type | Vereist | Beschrijving |
|---|---|---|---|
| content | string | Ja | Inhoud om te analyseren |
| fileType | string | Nee | Bestandstype voor inhoudsanalyse (standaard: txt) |
Analyse
Inhoud analyseren voor vertaalgereedheid
POST /analyze
Lichtgewicht validatie van brontekst om potentiële problemen te identificeren vóór vertaling. Retourneert validatieresultaten met foutcodes voor programmatische toegang. Dit endpoint verbruikt GEEN credits - het voert snelle, deterministische validatie uit zonder AI/LLM-aanroepen.
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()
}
Het bovenstaande commando geeft JSON terug, gestructureerd als volgt:
{
"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"
}
}
Parameters aanvraagbody
| Parameter | Type | Vereist | Beschrijving |
|---|---|---|---|
| targetLanguage | string | Ja | Doeltaal code voor vertaling |
| targetAudience | string | Nee | Doelgroep (standaard: algemeen) |
| industry | string | Nee | Industriecontext (standaard: algemeen) |
| sourceLanguage | string | Nee | Brontalcode (automatisch gedetecteerd indien niet opgegeven) |
| region | string | Nee | Specifieke regio voor lokalisatie |
| content | object | Ja | Te analyseren inhoud (tekst, reeks teksten of gestructureerd object) |
| fileType | string | Nee | Optioneel bestandstype als inhoud afkomstig is van een bestand |
Naamruimtevertalingen
Vertaalbestand uploaden voor hergebruik van naamruimte
POST /namespaces/{namespace}/translations/upload
Upload een bestaand vertaalbestand naar een naamruimte voor toekomstig hergebruik. Dit maakt kostenoptimalisatie mogelijk door eerder vertaalde strings opnieuw te gebruiken. Het bestand wordt verwerkt en vertaalparen worden geëxtraheerd voor caching.
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()
}
Het bovenstaande commando retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| namespace | Ja | Naamruimte-identificator (3-50 tekens, alfanumeriek + koppeltekens/underscores alleen) |
Verkrijg naamruimte-vertalingsstatistieken
GET /namespaces/{namespace}/translations/stats
Verkrijg statistieken over geüploade vertalingsbestanden en cache hergebruik voor een naamruimte
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| namespace | Ja | Naamruimte-identificator |
Geüploade vertalingsbestanden in naamruimte weergeven
GET /namespaces/{namespace}/translations/files
Verkrijg gepagineerde lijst van geüploade vertalingsbestanden voor een naamruimte
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| namespace | Ja | Naamruimte-identificatie |
| limit | Nee | Maximum aantal bestanden om te retourneren |
| offset | Nee | Aantal bestanden over te slaan voor paginering |
Geüploade vertaalbestand verwijderen
DELETE /namespaces/{namespace}/translations/files/{fileId}
Verwijder een geüpload vertaalbestand en alle bijbehorende vertalingsparen uit de cache
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Verplicht | Beschrijving |
|---|---|---|
| namespace | Ja | Naamruimte-identificatie |
| fileId | Ja | Bestand-ID om te verwijderen |
Parallel vertaalbestanden uploaden
POST /translations/upload-parallel
Upload bron- en doelbestanden parallel voor extractie en caching van vertaalparen. Beide bestanden moeten dezelfde structuur en bestandstype hebben.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Bestanden
Bestand downloaden uit opslag
GET /files/{filePath}
Levert bestanden uit lokale opslag (ontwikkeling) of S3 (productie). Wordt gebruikt voor het openen van geüploade en vertaalde bestanden.
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()
}
De bovenstaande opdracht retourneert JSON gestructureerd zoals dit:
{
"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"
}
}
Queryparameters
| Parameter | Vereist | Beschrijving |
|---|---|---|
| filePath | Ja | Bestandspad inclusief eventuele submappen (bijv. 'uploads/test-file.json' of 'vertalingen/result.json') |
Fouten
De i18n-agent API gebruikt de volgende foutcodes:
| Foutcode | Betekenis |
|---|---|
| 400 | Ongeldige aanvraag -- Uw aanvraag is ongeldig. |
| 401 | Niet geautoriseerd -- Uw API-sleutel is ongeldig. |
| 402 | Betaling vereist -- Onvoldoende tegoed op uw account. |
| 403 | Verboden -- Uw API-sleutel is inactief of team niet gevonden. |
| 404 | Niet gevonden -- De opgegeven bron kon niet worden gevonden. |
| 500 | Interne serverfout -- We hadden een probleem met onze server. Probeer het later opnieuw. |
| 503 | Service niet beschikbaar -- We zijn tijdelijk offline voor onderhoud. Probeer het later opnieuw. |
Foutreactieformaat
{
"error": "Detailed error message describing what went wrong",
"success": false
}