API Documentation

Complete reference for the Babelfish Translation API

Quick Start

Get up and running with the API in minutes

  1. Create an API key in the Keys section
  2. Make your first translation request
  3. Monitor usage in the Usage dashboard
  4. Set up billing in the Billing

Authentication

All API requests require authentication using your API key

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with your actual API key

API Endpoints

POST/translate/text

Translate text from one language to multiple target languages

Request

{ "text": "Hello, world!", "source_lang": "en", "target_langs": [ "es", "fr", "de" ] }

Response

{ "translations": { "es": "¡Hola, mundo!", "fr": "Bonjour le monde!", "de": "Hallo Welt!" } }

Code Examples

curl -X POST https://api.babelfish.fun/translate/text \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Hello, world!", "source_lang": "en", "target_langs": ["es", "fr"] }'

Error Codes

400Bad Request
401Unauthorized
429Too Many Requests
500Internal Server Error