Translate API

Quickstart

Integrate translation into your app in minutes.

Quickstart

Integrate translation into your app in minutes.

1. Create an account & workspace

Sign up and create a workspace at /sign-up. A workspace groups your projects, operator tokens, and usage quota.

2. Generate an operator token

Navigate to Account → Operator tokens and click Create operator token. Pick the workspaces it may act on and copy the token — it is shown only once.

Keep your token secret. Never commit it to source control.

3. Make your first translation request

Replace opt_your-token, my-workspace, and your domain.

cURL

curl -X POST https://your-domain.com/api/v1/translate \
  -H "Authorization: Bearer opt_your-token" \
  -H "Content-Type: application/json" \
  -d '{"text":"Bonjour le monde","source_lang":"fr","target_lang":"en-US","workspace":"my-workspace"}'

Node.js

const res = await fetch("https://your-domain.com/api/v1/translate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer opt_your-token",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "Bonjour le monde",
    source_lang: "fr",
    target_lang: "en-US",
    workspace: "my-workspace",
  }),
});

const data = await res.json();
console.log(data.translatedText); // "Hello world"

Python

import requests

response = requests.post(
    "https://your-domain.com/api/v1/translate",
    headers={
        "Authorization": "Bearer opt_your-token",
        "Content-Type": "application/json",
    },
    json={
        "text": "Bonjour le monde",
        "source_lang": "fr",
        "target_lang": "en-US",
        "workspace": "my-workspace",
    },
)

print(response.json()["translatedText"])  # "Hello world"

4. Use glossaries for consistent terminology

Create glossaries in Dashboard → Settings → Glossaries to enforce brand names and specialised terms. Glossaries are automatically applied when a project_slug is specified in your API call.

Learn more in the Glossaries guide.

5. Monitor usage

Check your monthly quota via the API or the dashboard.

curl "https://your-domain.com/api/v1/usage?workspace=my-workspace" \
  -H "Authorization: Bearer opt_your-token"

# {"monthlyCharacters":12450,"monthlyRequests":342,"workspace":{"slug":"my-workspace",...}}

When usage exceeds your quota, the API returns 429 Monthly character quota exceeded. Upgrade your plan in Settings → Billing.

Next Steps

On this page