API Reference
Authentication
All API requests require an API key. Include it in the Authorization header:
Authorization: Bearer your-api-keyAPI keys are scoped to a repository. Generate them from the dashboard under Project Settings > API Keys.
Base URL
https://api.lokalio.ioFor self-hosted instances, use your custom domain.
Endpoints
List Projects
GET /api/projectsReturns all projects for your organization.
Response: 200 OK
{
"projects": [
{
"id": "proj_abc123",
"name": "My App",
"sourceLanguage": "en",
"targetLanguages": ["fr", "de", "ja"],
"createdAt": "2026-01-15T10:30:00Z"
}
]
}Get Translations
GET /api/projects/:projectId/translationsReturns translations for a specific project.
Query Parameters:
| Parameter | Description |
|---|---|
lang | Filter by language code (e.g., fr) |
namespace | Filter by namespace |
Response: 200 OK
{
"translations": [
{
"key": "app.greeting",
"sourceValue": "Hello",
"translations": {
"fr": "Bonjour",
"de": "Hallo",
"ja": "こんにちは"
}
}
]
}Translate
POST /api/translateSend strings for AI translation. Used primarily by the CLI.
Request Body:
{
"sourceLanguage": "en",
"targetLanguages": ["fr", "de"],
"strings": [
{ "key": "app.greeting", "value": "Hello, {name}!" }
],
"context": {
"description": "SaaS analytics dashboard",
"tone": "professional",
"glossary": [
{ "sourceTerm": "Dashboard", "targetTerm": "Tableau de bord", "targetLanguage": "fr" }
]
}
}Response: 200 OK
{
"translations": [
{
"key": "app.greeting",
"translations": {
"fr": "Bonjour, {name} !",
"de": "Hallo, {name}!"
}
}
]
}Rate Limiting
The API enforces rate limits to protect against abuse:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Remaining requests in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
When the limit is exceeded, the API returns 429 Too Many Requests.