My App
Api
POST
/translate

Translate text, HTML, or structured JSON. Provide exactly one of text, html, or content. Translation memory is checked first (free), then glossary terms are enforced, and remaining strings are translated via LLM (metered by source word count).

x-api-key<token>

API key from the LangRelay dashboard. Org-level keys can access all projects; project-scoped keys are restricted to one project.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.langrelay.com/v1/translate" \  -H "Content-Type: application/json" \  -d '{    "projectId": "proj_abc123",    "text": "Hello world",    "targetLanguage": "fr"  }'
{
  "sourceText": "string",
  "translatedText": "string",
  "language": "string"
}
{
  "type": "https://api.langrelay.com/errors/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "projectId and language query parameters are required."
}
{
  "type": "https://api.langrelay.com/errors/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "projectId and language query parameters are required."
}
{
  "type": "https://api.langrelay.com/errors/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "projectId and language query parameters are required."
}