Getting started
Authenticate safely, make your first Lingopal API request, and choose the right workflow for text, files, media, documents, or subtitles.
Lingopal uses X-API-Key authentication. Text translation returns immediately; file-based workflows return a reusable job_id and run asynchronously.
Authentication
Every public API request uses an X-API-Key header. Lingopal does not use bearer tokens for this API.
Store the key server-side in an environment variable:
export LINGOPAL_API_KEY="your-api-key"Obtain, rotate, and revoke keys through the Lingopal dashboard or your account contact.
Keep API keys private:
- Never commit a key or put it in browser-side code.
- Keep
.envfiles out of version control. - Rotate a key immediately if it is exposed.
- Use separate keys for development and production when available.
A 401 response means the header is missing or the key is invalid. Confirm the header name is exactly X-API-Key, the environment variable is populated, and the key has not been revoked.
Make your first request
With LINGOPAL_API_KEY set, translate one string:
curl https://api.lingopal.ai/v2/translate/text \
-H "X-API-Key: $LINGOPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"texts":["Hello world"],"target_language":"es"}'Authorization
APIKeyHeader In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v2/translate/text" \ -H "Content-Type: application/json" \ -d '{ "texts": [ "Hello world", "Welcome to Lingopal" ], "target_language": "es" }'{ "status": "completed", "translations": [ { "source_text": "Hello world", "target_language": "es", "translated_text": "Hola mundo" } ], "workflow": "translate_text"}A successful response contains the translated text. For all request and response fields, use the API Reference entry for translateText.
Choose a workflow
| Goal | Start here |
|---|---|
| Translate one to 100 text strings | Translate text |
| Translate audio or video | Translate media |
| Translate a document | Translate documents |
| Generate subtitle tracks | Generate subtitles |
| Upload or register a file | Upload and register source files |
For asynchronous workflows, save the returned job_id, start a workflow, and follow the job lifecycle.