Translation API
Lexis Pro includes a local REST API server for managing StringTable entries programmatically. The API runs on localhost inside the Unity Editor and exposes CRUD endpoints for localization data.
Designed for:
- LLM coding tools (Claude Code, ChatGPT, Cursor, Copilot)
- CI/CD pipelines and build scripts
- Custom external tooling and automation
- Content management system integration
Quick Start
- Open the Translation API window: Tools > KitStack > Lexis > Translation API
- Click Start Server
- Verify the API is running:
curl http://127.0.0.1:8200/api/v1/statusResponse:
{
"status": "ok",
"version": "1.3.0",
"project": "MyGame"
}Endpoint Reference
All endpoints are prefixed with /api/v1/. The API accepts and returns JSON.
GET /api/v1/status
Returns server health, Lexis version, and project name.
curl http://127.0.0.1:8200/api/v1/status{
"status": "ok",
"version": "1.3.0",
"project": "MyGame"
}GET /api/v1/locales
Returns all locales configured in LocalizationSettings.
curl http://127.0.0.1:8200/api/v1/locales{
"locales": [
{ "code": "en", "displayName": "English", "nativeName": "English" },
{ "code": "de", "displayName": "German", "nativeName": "Deutsch" },
{ "code": "ja", "displayName": "Japanese", "nativeName": "日本語" }
]
}GET /api/v1/tables
Returns summary information for all registered string tables.
curl http://127.0.0.1:8200/api/v1/tables{
"tables": [
{ "tableId": "UI", "entryCount": 42 },
{ "tableId": "Gameplay", "entryCount": 128 }
]
}GET /api/v1/tables/
Returns all entries in a string table with full details.
curl http://127.0.0.1:8200/api/v1/tables/UI{
"tableId": "UI",
"entryCount": 2,
"entries": [
{
"key": "ui.welcome",
"defaultValue": "Welcome back!",
"comment": "Main menu greeting",
"context": "main_menu",
"tags": ["ui"],
"maxLength": 50,
"translations": [
{ "localeCode": "en", "value": "Welcome back!" },
{ "localeCode": "de", "value": "Willkommen zurueck!" }
]
}
]
}GET /api/v1/tables/{tableId}/entries/
Returns a single entry by key.
curl http://127.0.0.1:8200/api/v1/tables/UI/entries/ui.welcome{
"key": "ui.welcome",
"defaultValue": "Welcome back!",
"comment": "Main menu greeting",
"context": "main_menu",
"tags": ["ui"],
"maxLength": 50,
"translations": [
{ "localeCode": "en", "value": "Welcome back!" },
{ "localeCode": "de", "value": "Willkommen zurueck!" }
]
}POST /api/v1/tables/{tableId}/entries
Creates new entries or updates existing ones in batch. If an entry with the given key exists, only non-null fields are overwritten.
curl -X POST http://127.0.0.1:8200/api/v1/tables/UI/entries \
-H "Content-Type: application/json" \
-d '{
"entries": [
{
"key": "ui.welcome",
"defaultValue": "Welcome back, adventurer!",
"comment": "Shown after first login",
"translations": [
{ "localeCode": "de", "value": "Willkommen zurueck, Abenteurer!" },
{ "localeCode": "fr", "value": "Bon retour, aventurier!" }
]
},
{
"key": "ui.goodbye",
"defaultValue": "See you later!",
"translations": [
{ "localeCode": "de", "value": "Bis spaeter!" }
]
}
]
}'{
"created": 1,
"updated": 1,
"total": 2
}DELETE /api/v1/tables/{tableId}/entries/
Deletes an entry from the string table. The operation is registered with Unity's Undo system.
curl -X DELETE http://127.0.0.1:8200/api/v1/tables/UI/entries/ui.goodbye{
"deleted": true
}GET /api/v1/openapi.json
Returns the full OpenAPI 3.0.1 specification for this API. Use this to generate tool definitions for LLM integrations.
curl http://127.0.0.1:8200/api/v1/openapi.jsonLLM Integration Examples
Claude Code
Claude Code can interact with your localization data directly using the Translation API. Start the server in Unity, then use curl from Claude Code's tool system:
# List all tables
curl -s http://127.0.0.1:8200/api/v1/tables | jq .
# Read all entries from a table
curl -s http://127.0.0.1:8200/api/v1/tables/UI | jq .
# Add a new entry with translations
curl -s -X POST http://127.0.0.1:8200/api/v1/tables/UI/entries \
-H "Content-Type: application/json" \
-d '{
"entries": [{
"key": "ui.new_feature",
"defaultValue": "Try our new feature!",
"comment": "Feature announcement banner",
"translations": [
{ "localeCode": "de", "value": "Probiere unser neues Feature!" },
{ "localeCode": "fr", "value": "Essayez notre nouvelle fonctionnalite!" }
]
}]
}'Fetching Tool Definitions
LLM tools can fetch the OpenAPI schema to discover available endpoints automatically:
curl -s http://127.0.0.1:8200/api/v1/openapi.json > lexis-api.jsonThis schema can be used as a tool definition for OpenAI function calling, Anthropic tool use, or any other LLM tool framework that accepts OpenAPI specifications.
Workflow Example
A typical LLM-assisted localization workflow:
- Fetch locales to know which languages are configured
- Read table entries to understand existing translations
- Add or update entries with new translations generated by the LLM
- Verify by reading back the updated entries
# Step 1: What languages does this project support?
curl -s http://127.0.0.1:8200/api/v1/locales | jq '.locales[].code'
# Step 2: What entries exist in the UI table?
curl -s http://127.0.0.1:8200/api/v1/tables/UI | jq '.entries[] | {key, defaultValue}'
# Step 3: Add translations for a missing entry
curl -s -X POST http://127.0.0.1:8200/api/v1/tables/UI/entries \
-H "Content-Type: application/json" \
-d '{"entries": [{"key": "ui.settings", "defaultValue": "Settings", "translations": [{"localeCode": "de", "value": "Einstellungen"}, {"localeCode": "ja", "value": "設定"}]}]}'
# Step 4: Verify
curl -s http://127.0.0.1:8200/api/v1/tables/UI/entries/ui.settings | jq .Configuration
| Setting | Default | Description |
|---|---|---|
| Port | 8200 | The localhost port the API server listens on. Change in the Translation API window. |
| Auto-start | Off | When enabled, the server starts automatically when Unity opens. |
The server binds to 127.0.0.1 (localhost only) and is accessible at http://127.0.0.1:{port}/api/v1/.
Security
- Localhost only: The server binds exclusively to
127.0.0.1. It is not accessible from other machines on the network. - No authentication: Since the server only accepts local connections, no API keys or tokens are required.
- CORS enabled: Cross-origin requests are allowed to support browser-based tools running on localhost.
- Editor only: The server runs only inside the Unity Editor. It is not included in runtime builds.
- Undo support: All write operations (POST, DELETE) are registered with Unity's Undo system, so changes can be reverted.
Error Handling
All errors return a consistent JSON structure:
{
"error": "Human-readable error message",
"code": "MACHINE_READABLE_CODE",
"status": 404
}| Code | Status | Meaning |
|---|---|---|
NOT_FOUND | 404 | Endpoint, table, or entry does not exist |
TABLE_NOT_FOUND | 404 | The specified string table was not found |
ENTRY_NOT_FOUND | 404 | The specified entry key was not found |
EMPTY_BODY | 400 | POST request has no body |
INVALID_JSON | 400 | Request body is not valid JSON |
EMPTY_ENTRIES | 400 | Entries array is empty or missing |
NO_SETTINGS | 500 | LocalizationSettings asset not found |
INTERNAL_ERROR | 500 | Unexpected server error |
