Translate text to any of 100+ supported languages using neural machine translation.
Endpoint
Copy
Ask AI
POST /translate/v1/translate
Copy
Ask AI
import Casedev from 'casedev';const client = new Casedev({ apiKey: 'sk_case_YOUR_API_KEY' });const result = await client.translate.v1.translate({ q: 'The plaintiff filed a motion for summary judgment.', target: 'es'});console.log(result.data.translations[0].translatedText);// "El demandante presentó una moción de juicio sumario."
Response
Copy
Ask AI
{ "data": { "translations": [ { "translatedText": "El demandante presentó una moción de juicio sumario.", "detectedSourceLanguage": "en" } ] }}
const document = `NOTICE OF MOTIONPLEASE TAKE NOTICE that the undersigned will move this Courtat the Courthouse located at 100 Centre Street, New York, NYon the 15th day of January, 2025, at 9:30 a.m., for an order...`;const result = await client.translate.v1.translate({ q: document, target: 'es'});
// Source language is detected automaticallyconst result = await client.translate.v1.translate({ q: 'Bonjour, comment puis-je vous aider?', target: 'en'});console.log(result.data.translations[0].detectedSourceLanguage); // "fr"console.log(result.data.translations[0].translatedText); // "Hello, how can I help you?"
Pricing: $0.05 per 1,000 characters. A 50,000 character document costs $2.50.