Customizing Your translation
Contextual Adaptation Parameters
Enhance your translations with linguistic context controls:-
Formality Level (Optional):
Setting Value Use Case Formal 1 Business documents, academic papers, official correspondence Casual 2 Chat messages, social media, casual communication -
Grammatical Gender (Optional):
Applies to languages with gender-specific grammar
Setting Value Not Specified 0 Male 1 Female 2 Neutral 9
Language Support
-
Configure your translation pipeline using:
-
/source-languages
- Supported input languages -
/target-languages
- Available output languages
-
Implementation Guide
Streaming Translation Workflow:-
Use synchronous (
requests
) for:- Simple scripts
- Low-concurrency applications
- Quick prototyping
-
Use asynchronous (
aiohttp
) for:- High-performance applications
- Parallel translation streams
- Web servers with async frameworks
Response Handling
- Stream Format: UTF-8 encoded text/event-stream with incremental translations.
-
Credit Tracking:
X-Credits-Required
header shows computational resources used. - Error Handling: Failed streams immediately terminate with error message.
Use Case Examples
- Live Caption Translation: Convert spoken language subtitles in real-time
- Chat Localization: Instant message translation for multilingual support teams
- Document Preview: Stream translated content while full processing continues
Authorizations
The x-api-key
is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.
Body
Response
Text translation stream
The response is of type string
.