Lilt API API Reference

The Lilt API enables programmatic configuration of the Lilt CAT environment (the Interface) and access to domain-adapted TM/MT systems. It can also be used to augment an existing translation management system with Lilt translation technology. The API is distinguished by the following features:

  • Real-time personalization / training to target domains.

  • Integrated translation memory.

  • Rich translation output including n-best lists, word alignments, and formatting advice.

  • Programmatic configuration of the Lilt CAT environment.

Requests and responses are in JSON format. The API only responds to HTTPS / SSL requests. The API authenticates via an API key, which is included with the Business billing tier.

API Endpoint
https://lilt.com/1
Contact: support@lilt.com
Schemes: https
Version: v1.0

Authentication

api_key

name
apikey
in
query

Root

Retrieve the API root

GET /

This resource does not have any attributes. It lists the top-level API endpoints. Use it to verify API keys.

200 OK

OK

Memories

Create a Memory

POST /mem/create

Create a new Memory.

Memory specification

name: string

A name for the Memory.

srclang: string

An ISO639-1 language identifier.

tgtlang: string

An ISO639-1 language identifier.

Request Example
{
  "name": "string",
  "srclang": "string",
  "tgtlang": "string"
}
200 OK

OK

Response Example (200 OK)
{
  "memory_id": "integer",
  "srclang": "string",
  "tgtlang": "string",
  "name": "string",
  "nexamples": "integer"
}

Retrieve a Memory

GET /mem

View the status of a Memory by specifying memory_id. Omit the memory_id to list all Memories associated with the API key.

memory_id

An optional memory identifier.

type
integer
in
query
200 OK

OK

Response Example (200 OK)
[
  {
    "memory_id": "integer",
    "srclang": "string",
    "tgtlang": "string",
    "name": "string",
    "nexamples": "integer"
  }
]

Update a Memory

POST /mem

Add a translation for a source segment to a Memory. The translation will influence future predictions of the designated memory_id. Either an existing segment_id or a source string—but not both—may be supplied.

Memory specification

memory_id: integer

Unique memory identifier.

segment_id: integer

Unique segment identifier.

source: string

The source string.

target: string

The target string.

Request Example
{
  "memory_id": "integer",
  "segment_id": "integer",
  "source": "string",
  "target": "string"
}
200 OK

OK

Response Example (200 OK)
{
  "updated_at": "string (date)"
}

Delete a Memory

DELETE /mem

Delete a Memory.

memory_id

An optional memory identifier.

type
integer
in
query
200 OK

OK

Response Example (200 OK)
{
  "deleted_at": "string (date)",
  "memory_id": "integer"
}

Projects

Create a Project

POST /pm/project

Create a Project resource. A Project is a container for Document resources.

Project specification

memory_id: integer

The Memory with which this Project will be associated.

name: string

A name for the new Project.

Request Example
{
  "memory_id": "integer",
  "name": "string"
}
200 OK

OK

Response Example (200 OK)
{
  "memory_id": "integer",
  "name": "string",
  "project_id": "integer",
  "srclang": "string",
  "tgtlang": "string"
}

Retrieve a Project

GET /pm/project

List all active Project resources. Deleted Project resources are not returned.

srclang

An ISO639-1 language code.

type
string
in
query
tgtlang

An ISO639-1 language code.

type
string
in
query
200 OK

OK

Response Example (200 OK)
[
  {
    "project_id": "integer",
    "memory_id": "integer",
    "srclang": "string",
    "tgtlang": "string",
    "name": "string"
  }
]

Documents

Retrieve a Document

GET /pm/project/docs

List all Document resources for a Project resource.

id

The unique Document identifier.

type
integer
in
query
200 OK

OK

Response Example (200 OK)
[
  {
    "doc_id": "integer",
    "srclang": "string",
    "tgtlang": "string",
    "name": "string"
  }
]

Share/Unshare a Document

PUT /pm/project/docs/share

Share a Document with a user for translation in the Interface. This endpoint can also be used to unshare the Document.

Document specification

doc_id: integer

A unique Document identifier.

email: string

An email address.

project_id: integer

A unique Project identifier.

share: boolean

If false, then unshare the document.

Request Example
{
  "doc_id": "integer",
  "email": "string",
  "project_id": "integer",
  "share": "boolean"
}
200 OK

OK

Response Example (200 OK)
{
  "doc_id": "integer",
  "share": "boolean"
}

Segments

Create a Segment

POST /pm/segment

Add a source Segment to a Document resource.

Segment specification

Request Example
{
  "text": "string",
  "doc_id": "integer",
  "doc_name": "string",
  "project_id": "integer"
}
200 OK

OK

Response Example (200 OK)
{
  "doc_id": "integer",
  "segment_id": "integer"
}

Retrieve a Segment

GET /pm/segment

Get a Segment resource, including a target string, if any, that was created in the Interface.

id

The Segment identifier.

type
integer
in
query
200 OK

OK

Response Example (200 OK)
[
  {
    "created_at": "string (date)",
    "doc_id": "integer",
    "memory_id": "integer",
    "source": "string",
    "srclang": "string",
    "target": "string",
    "tgtlang": "string",
    "updated_at": "string (date)"
  }
]

Translate

Translate a segment

GET /tr

Translate a source string.

memory_id

A memory identifier.

type
integer
in
query
source

The source text to be translated.

type
string
in
query
source_hash

A source hash code.

type
integer
in
query
prefix

A target prefix.

type
string
in
query
n

Return n best translations, default 1.

type
integer
in
query
rich

If true, returns rich translation info in the response.

type
boolean
in
query

OK

Response Example (200 OK)
{
  "untokenizedSource": "string",
  "tokenizedSource": "string",
  "sourceDelimiters": [
    "string"
  ],
  "translation": [
    {
      "target": "string",
      "align": "string",
      "provenance": "string",
      "score": "number",
      "isTMMatch": "boolean",
      "targetDelimiters": [
        "string"
      ]
    }
  ],
  "procTime": "integer"
}

Register a segment

POST /tr/seg

Register a source string for prefix translation.

Segment specification

source: string

A source string to be registered.

srclang: string

An ISO639-1 language code.

tgtlang: string

An ISO639-1 language code.

Request Example
{
  "source": "string",
  "srclang": "string",
  "tgtlang": "string"
}
200 OK

OK

Response Example (200 OK)
"integer"

Schema Definitions

Project: object

Represents a project. It can contain multiple documents, and is specific to a language pair. A Project is always associated with a Memory, and memories cannot be changed once the project is created.

project_id: integer

A unique number identifying the project.

memory_id: integer

A unique number identifying the associated memory.

srclang: string

An ISO639-1 language identifier.

tgtlang: string

An ISO639-1 language identifier.

name: string

An optional string alias for the memory.

Example
{
  "project_id": "integer",
  "memory_id": "integer",
  "srclang": "string",
  "tgtlang": "string",
  "name": "string"
}

Document: object

Represents a document. It is a collection of Segments.

doc_id: integer

A unique number identifying the document.

srclang: string

An ISO639-1 language identifier.

tgtlang: string

An ISO639-1 language identifier.

name: string

An optional string alias for the document.

Example
{
  "doc_id": "integer",
  "srclang": "string",
  "tgtlang": "string",
  "name": "string"
}

Memory: object

A Memory is a collection of parallel (source/target) segments from which a MT/TM model is trained. When a translator confirms a segment in the Interface, a parallel segment is added to the Memory. Parallel segments from existing translation memories and bitexts can also be added to the Memory via the API.

memory_id: integer

A unique number identifying the memory.

srclang: string

An ISO639-1 language identifier.

tgtlang: string

An ISO639-1 language identifier.

name: string

An optional string alias for the memory.

nexamples: integer

The number of confirmed Segments incorporated into this Memory.

Example
{
  "memory_id": "integer",
  "srclang": "string",
  "tgtlang": "string",
  "name": "string",
  "nexamples": "integer"
}

Translation: object

Represents the translation of a source segment in a Document.

target: string

The target string.

align: string

A whitespace delimited list of source-target alignment indices.

provenance: string

Positive values indicate that the token is from the memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches.

score: number

The score of the translation.

isTMMatch: boolean

If true, indicates an exact TM match.

targetDelimiters: string[]

A format string that indicates, for each token, if the token should be preceded by a space.

Example
{
  "target": "string",
  "align": "string",
  "provenance": "string",
  "score": "number",
  "isTMMatch": "boolean",
  "targetDelimiters": [
    "string"
  ]
}

TranslationList: object

An object containing translations and associated metadata.

untokenizedSource: string

The untokenized source segment.

tokenizedSource: string

The tokenized source segment.

sourceDelimiters: string[]

A format string that indicates, for each token, if the token should be preceded by a space.

translation: object[]

One or more Translation objects.

procTime: integer

The processing time in milliseconds.

Example
{
  "untokenizedSource": "string",
  "tokenizedSource": "string",
  "sourceDelimiters": [
    "string"
  ],
  "translation": [
    {
      "target": "string",
      "align": "string",
      "provenance": "string",
      "score": "number",
      "isTMMatch": "boolean",
      "targetDelimiters": [
        "string"
      ]
    }
  ],
  "procTime": "integer"
}

Segment: object

A segment, including document and project ids that the segment is associated with.

text: string

The source string.

doc_id: integer

The Document id. If unspecified, then a new document is created.

doc_name: string

Optional name for a new document.

project_id: integer

The Project id to associate a newly created Document with.

Example
{
  "text": "string",
  "doc_id": "integer",
  "doc_name": "string",
  "project_id": "integer"
}

RichSegment: object

A segment with additional metadata.

created_at: string (date)

An ISO8601 date.

doc_id: integer

Unique Document identifier.

memory_id: integer

The memory with which this segment is associated.

source: string

The source string.

srclang: string

An ISO639-1 language code.

target: string

The target string.

tgtlang: string

An ISO639-1 language code.

updated_at: string (date)

An ISO8601 date.

Example
{
  "created_at": "string (date)",
  "doc_id": "integer",
  "memory_id": "integer",
  "source": "string",
  "srclang": "string",
  "target": "string",
  "tgtlang": "string",
  "updated_at": "string (date)"
}