Quickstart

Learn how to get started with the Lia API in 5 minutes - generate an API key, verify authentication, and make your first translation request.

1

Generate API Key

Generate an API key from your workspace settings:

  1. Navigate to your workspace settings at lia.acolad.aiarrow-up-right

  2. Go to SettingsAPI Keys

  3. Click New API Key

  4. Fill in the form:

    • Name: Add a descriptive name (e.g., "Production API Server")

    • Expiration: Select an expiration period or leave it without expiration

    • Permissions: Choose "Full access" for all workspace actions

  5. Click Create and copy your API key

circle-exclamation
circle-info

All actions performed with the API key are attributed to you as an individual user.

2

Make Your First Request

Verify your API key works by calling the identity endpoint:

curl https://api.acolad.ai/whoami \
  -H "x-api-key: YOUR_API_KEY"

Expected response:

{
  "user": {
    "id": "user_123",
    "email": "[email protected]",
    "name": "John Doe"
  },
  "workspace": {
    "id": "ws_abc",
    "name": "Acme Corp"
  }
}
3

Translate Text

Translate text to another language:

curl -X POST https://api.acolad.ai/translate/text \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello world",
    "targetLang": "fr"
  }'

Expected response:

{
  "translation": "Bonjour le monde",
  "characterCount": 11,
  "detectedSourceLang": "en"
}

With source language:

Specify the source language explicitly for better accuracy:

curl -X POST https://api.acolad.ai/translate/text \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello world",
    "sourceLang": "en",
    "targetLang": "es"
  }'

Response:

{
  "translation": "Hola mundo",
  "characterCount": 11,
  "detectedSourceLang": "en"
}

Next Steps

Overviewchevron-rightAuthenticationchevron-rightVersioningchevron-rightPaginationchevron-rightErrorschevron-right

Last updated

Was this helpful?