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.

undefined
Request Example
{
  "properties": {
    "name": {
      "description": "A name for the Memory.",
      "type": "string"
    },
    "srclang": {
      "description": "An ISO639-1 language identifier.",
      "type": "string"
    },
    "tgtlang": {
      "description": "An ISO639-1 language identifier.",
      "type": "string"
    }
  },
  "required": [
    "srclang",
    "tgtlang",
    "name"
  ],
  "type": "object"
}
200 OK

OK

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

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",
    "name": "string",
    "nexamples": "integer",
    "srclang": "string",
    "tgtlang": "string"
  }
]

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.

undefined
Request Example
{
  "properties": {
    "memory_id": {
      "description": "Unique memory identifier.",
      "type": "integer"
    },
    "segment_id": {
      "description": "Unique segment identifier.",
      "type": "integer"
    },
    "source": {
      "description": "The source string.",
      "type": "string"
    },
    "target": {
      "description": "The target string.",
      "type": "string"
    }
  },
  "required": [
    "memory_id",
    "source",
    "target"
  ],
  "type": "object"
}
200 OK

OK

Response Example (200 OK)
{
  "properties": {
    "updated_at": {
      "description": "An ISO8601 date.",
      "format": "date",
      "type": "string"
    }
  },
  "required": [
    "updated_at"
  ],
  "type": "object"
}

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)
{
  "properties": {
    "deleted_at": {
      "description": "An ISO8601 date.",
      "format": "date",
      "type": "string"
    },
    "memory_id": {
      "description": "A memory identifier.",
      "type": "integer"
    }
  },
  "required": [
    "deleted_at",
    "memory_id"
  ],
  "type": "object"
}

Projects

Create a Project

POST /pm/project

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

undefined
Request Example
{
  "properties": {
    "memory_id": {
      "description": "The Memory with which this Project will be associated.",
      "type": "integer"
    },
    "name": {
      "description": "A name for the new Project.",
      "type": "string"
    }
  },
  "required": [
    "memory_id",
    "name"
  ],
  "type": "object"
}
200 OK

OK

Response Example (200 OK)
{
  "properties": {
    "memory_id": {
      "description": "The Memory with which this Project is associated.",
      "type": "integer"
    },
    "name": {
      "description": "The name of the Project.",
      "type": "string"
    },
    "project_id": {
      "description": "A unique Project identifier.",
      "type": "integer"
    },
    "srclang": {
      "description": "An ISO639-1 language code.",
      "type": "string"
    },
    "tgtlang": {
      "description": "An ISO639-1 language code.",
      "type": "string"
    }
  },
  "required": [
    "project_id",
    "srclang",
    "tgtlang",
    "memory_id",
    "name"
  ],
  "type": "object"
}

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)
[
  {
    "memory_id": "integer",
    "name": "string",
    "project_id": "integer",
    "srclang": "string",
    "tgtlang": "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",
    "name": "string",
    "srclang": "string",
    "tgtlang": "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.

undefined
Request Example
{
  "properties": {
    "doc_id": {
      "description": "A unique Document identifier.",
      "type": "integer"
    },
    "email": {
      "description": "An email address.",
      "type": "string"
    },
    "project_id": {
      "description": "A unique Project identifier.",
      "type": "integer"
    },
    "share": {
      "description": "If false, then unshare the document.",
      "type": "boolean"
    }
  },
  "required": [
    "project_id",
    "doc_id",
    "email",
    "share"
  ],
  "type": "object"
}
200 OK

OK

Response Example (200 OK)
{
  "properties": {
    "doc_id": {
      "description": "A unique Document identifier.",
      "type": "integer"
    },
    "share": {
      "description": "If false, then the document is unshared.",
      "type": "boolean"
    }
  },
  "type": "object"
}

Segments

Create a Segment

POST /pm/segment

Add a source Segment to a Document resource.

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

OK

Response Example (200 OK)
{
  "properties": {
    "doc_id": {
      "description": "Unique Document identifier.",
      "type": "integer"
    },
    "segment_id": {
      "description": "Unique Segment identifier.",
      "type": "integer"
    }
  },
  "required": [
    "segment_id",
    "doc_id"
  ],
  "type": "object"
}

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)
{
  "procTime": "integer",
  "sourceDelimiters": "array",
  "tokenizedSource": "string",
  "translation": "array",
  "untokenizedSource": "string"
}

Register a segment

POST /tr/seg

Register a source string for prefix translation.

undefined
Request Example
{
  "properties": {
    "source": {
      "description": "A source string to be registered.",
      "type": "string"
    },
    "srclang": {
      "description": "An ISO639-1 language code.",
      "type": "string"
    },
    "tgtlang": {
      "description": "An ISO639-1 language code.",
      "type": "string"
    }
  },
  "required": [
    "srclang",
    "tgtlang",
    "source"
  ],
  "type": "object"
}
200 OK

OK

Response Example (200 OK)
{
  "type": "integer"
}

Models

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.

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.

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.

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.

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.

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.

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.