Download OpenAPI specification:Download
This API provides on-demand text translation.
| context | string Additional context to help with the translation. Optional. |
| text required | string The text to translate. |
| targetLanguage required | string The target language code (e.g., 'en', 'es'). |
{- "context": "Do you have any safety concerns?",
- "text": "No hay suficientes cascos para la tripulación.",
- "targetLanguage": "en"
}{- "translatedText": "This is the translated text",
- "originalLanguage": "es"
}Translates the next message in a conversation using the context provided by previous messages.
required | Array of objects (Message) |
required | object (Message) |
| targetLanguage required | string |
{- "previousMessages": [
- {
- "sender": "user123",
- "text": "Hello how are you?"
}, - {
- "sender": "user456",
- "text": "I'm fine thanks! And you?"
}
], - "nextMessage": {
- "sender": "user123",
- "text": "Me alegro yo también estoy bien."
}, - "targetLanguage": "en"
}{- "translatedText": "This is the translated text",
- "originalLanguage": "es"
}Uses a chatID to provide context for translating the next message in a conversation.
| chatID required | string The unique identifier for the conversation. |
required | object (Message) |
| targetLanguage required | string The target language code. |
{- "chatID": "123456789",
- "nextMessage": {
- "sender": "user123",
- "text": "Me alegro yo también estoy bien."
}, - "targetLanguage": "en"
}{- "translatedText": "This is the translated text",
- "originalLanguage": "es"
}