Algebras API Documentation
Welcome to the Algebras API documentation. This API provides translation services with secure authentication.
Authentication
Section titled “Authentication”All API endpoints require authentication using an API key. Include your API key in the X-Api-Key header with all requests.
X-Api-Key: your_api_key_here# Get API health statuscurl -X GET "https://platform.algebras.ai/api/v1/health" \ -H "X-Api-Key: your_api_key_here"Available Endpoints
Section titled “Available Endpoints”Health Check
Section titled “Health Check”Endpoint: GET /health
Checks the API’s health status.
Response Example:
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": { "health": "up", "version": "1.0.0" }}Language Support
Section titled “Language Support”Endpoint: GET /translation/languages
Retrieves the list of supported languages.
Response Example:
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": [ { "language": "en", "name": "English" }, { "language": "de", "name": "German" } ]}# Get list of supported languagescurl -X GET "https://platform.algebras.ai/api/v1/translation/languages" \ -H "X-Api-Key: your_api_key_here"Translation
Section titled “Translation”Endpoint: POST /translation/translate
Translates the given text to the target language.
Request Body:
{ "sourceLanguage": "auto", "targetLanguage": "de", "text": "Hello, World!"}Response Example:
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": "Hallo, Welt!"}# Translate text from English to Germancurl -X POST "https://platform.algebras.ai/api/v1/translation/translate" \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "sourceLanguage": "auto", "targetLanguage": "de", "text": "Hello, World!" }'Error Handling
Section titled “Error Handling”The API uses standard HTTP status codes and provides detailed error messages when validation fails.
Common Errors
Section titled “Common Errors”- 400 Bad Request: Invalid input parameters.
- 401 Unauthorized: Missing or invalid API key.
- 422 Validation Error: Request validation failed.
Example 400 Error Response:
{ "status": "error", "timestamp": "2025-01-12T22:31:48.856Z", "error": { "message": "Invalid source language code." }}For detailed information about each endpoint and feature, please refer to the specific documentation sections.