Translation API Tutorial

A developer-focused guide to the WesenAI Translation API, including translation, language detection, and more.

This tutorial provides a technically accurate guide to the WesenAI Translation API.

API Reference

  • Base URL: https://translation.api.wesen.ai
  • Authentication: Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY

Endpoints

Service Information

  • GET /v1: Get Translation service information.
  • GET /v1/health: Check service health status.

Translation

  • POST /v1/translate: Translate text between languages.
  • GET /v1/translate/detect: Detect the language of a text.

Translation Job Operations

  • POST /v1/job: Submit a new job.
  • GET /v1/job/{jobId}: Get the status of a translation job.
  • PUT /v1/job/{jobId}: Control a running translation job (stop, pause, resume).
  • POST /v1/job/stream: Submit a new translation job and stream the results.
  • GET /v1/job/{jobId}/result: Get the translation result of a completed job.
  • GET /v1/job/{jobId}/stream: Stream status updates for a job.

Translation Service Metadata

  • GET /v1/meta/info: Get service information.
  • GET /v1/meta/health: Check the health of the Translation service.
  • GET /v1/meta/languages: Get all supported languages.
  • GET /v1/meta/quotas: Get provider quotas and usage information.