> ## Documentation Index
> Fetch the complete documentation index at: https://support.lilt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate a segment

> Translate a source string.

Functionally identical to `POST /v2/translate`, with parameters passed
as query string parameters instead of a JSON request body. Useful for
simple integrations that prefer a GET request.

Setting the `rich` parameter to `true` will change the response format
to include additional information about each translation including a
model score, word alignments,  and formatting information.

By default, this endpoint also returns translation memory (TM) fuzzy matches, along
with associated scores. Fuzzy matches always appear ahead of machine translation
output in the response.

The maximum source length is 50,000 characters. When a `prefix` is supplied (prefix-based translation), the maximum source length is 5,000 characters.

Word-alignment and formatting fields (`targetWords`, `targetDelimiters`, and `provenance`) are returned only for prefix or `source_hash` requests. Plain (non-prefixed) translations return `target` and `targetWithTags` only. The source-side fields `tokenizedSource` and `sourceDelimiters` are no longer returned.

Usage charges apply to this endpoint for production API keys.





## OpenAPI

````yaml /api-reference/openapi-bundled.yaml get /v2/translate
openapi: 3.0.3
info:
  title: LILT API
  description: >
    LILT API Support: https://lilt.atlassian.net/servicedesk/customer/portals


    The LILT API enables programmatic access to the full-range of LILT backend
    services including:
      * Training of and translating with interactive, adaptive machine translation
      * Large-scale translation memory
      * The Lexicon (a large-scale termbase)
      * Programmatic control of the LILT CAT environment
      * Translation memory synchronization


    Requests and responses are in JSON format. The REST API only responds to
    HTTPS / SSL requests.


    The base url for this REST API is `https://api.lilt.com/`.


    ## Authentication


    Requests are authenticated via API key, which requires the Business plan.


    Requests are authenticated using [HTTP Basic
    Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your
    API key as both the `username` and `password`.


    For development, you may also pass the API key via the `key` query
    parameter. This is less secure than HTTP Basic Auth, and is not recommended
    for production use.


    ## Quotas


    Our services have a general quota of 4000 requests per minute. Should you
    hit the maximum requests per minute, you will need to wait 60 seconds before
    you can send another request.
  version: v3.0.3
  license:
    name: LILT Platform Terms and Conditions
    url: https://lilt.com/lilt-platform-terms-and-conditions
servers:
  - url: https://api.lilt.com
security:
  - BasicAuth: []
  - ApiKeyAuth: []
paths:
  /v2/translate:
    get:
      tags:
        - Translate
      summary: Translate a segment
      description: >+
        Translate a source string.


        Functionally identical to `POST /v2/translate`, with parameters passed

        as query string parameters instead of a JSON request body. Useful for

        simple integrations that prefer a GET request.


        Setting the `rich` parameter to `true` will change the response format

        to include additional information about each translation including a

        model score, word alignments,  and formatting information.


        By default, this endpoint also returns translation memory (TM) fuzzy
        matches, along

        with associated scores. Fuzzy matches always appear ahead of machine
        translation

        output in the response.


        The maximum source length is 50,000 characters. When a `prefix` is
        supplied (prefix-based translation), the maximum source length is 5,000
        characters.


        Word-alignment and formatting fields (`targetWords`, `targetDelimiters`,
        and `provenance`) are returned only for prefix or `source_hash`
        requests. Plain (non-prefixed) translations return `target` and
        `targetWithTags` only. The source-side fields `tokenizedSource` and
        `sourceDelimiters` are no longer returned.


        Usage charges apply to this endpoint for production API keys.

      operationId: translateSegmentGet
      parameters:
        - name: source
          in: query
          description: The source string to translate.
          schema:
            type: string
        - description: A unique Memory identifier.
          in: query
          name: memory_id
          required: true
          schema:
            type: integer
        - name: source_hash
          in: query
          description: A source hash code.
          schema:
            type: integer
        - name: 'n'
          in: query
          description: Return top n translations (deprecated).
          schema:
            type: integer
        - name: prefix
          in: query
          description: A target prefix.
          schema:
            type: string
        - name: rich
          in: query
          description: Returns rich translation information (e.g., with word alignments).
          schema:
            type: boolean
            default: false
        - name: tm_matches
          in: query
          description: Include translation memory fuzzy matches.
          schema:
            type: boolean
            default: true
        - name: project_tags
          in: query
          description: Project tags. Projects tags in source to target if set to true.
          schema:
            type: boolean
            default: false
        - name: contains_icu_data
          in: query
          description: >-
            Contains ICU data. If true then tags in the source following the ICU
            standard will be parsed and retained.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A TranslationList object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslationList'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TranslationList:
      type: object
      properties:
        untokenizedSource:
          type: string
          description: >-
            The untokenized source segment. Punctuation has not been separated
            from words.
          example: Authentication not required.
        tokenizedSource:
          type: string
          deprecated: true
          description: >-
            No longer returned by `/2/translate`. The tokenized source segment.
            Punctuation has been separated from words.
          example: Authentication not required .
        sourceDelimiters:
          type: array
          deprecated: true
          description: >-
            No longer returned by `/2/translate`. A format string that
            indicates, for each word, if the word should be preceded by a space.
          example:
            - ''
            - ' '
            - ' '
            - ''
            - ''
          items:
            type: string
        translation:
          type: array
          description: A list of Translation objects.
          items:
            $ref: '#/components/schemas/Translation'
      description: An ranked list of translations and associated metadata.
    Error:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message describing the error.
      description: |
        Response in the event of an unexpected error.
      example:
        message: Internal server error.
    Translation:
      type: object
      properties:
        target:
          type: string
          description: The target string.
        targetWithTags:
          type: string
          description: The target string with source tags projected into the target.
        align:
          type: string
          description: >
            "MT only: A whitespace delimited list of source-target alignment
            indices."
        provenance:
          type: string
          description: >
            Positive values indicate that the word is from the Memory,

            with contiguous identical entries (e.g., 2 2) indicating

            phrase matches. Negative contiguous values indicate entries from the
            Lexicon.

            0 indicates a word from the background data.
        score:
          type: number
          description: The score of the translation.
        isTMMatch:
          type: boolean
          description: 'TM only: If true, indicates an exact translation memory match.'
        targetDelimiters:
          type: array
          description: >-
            A format string that indicates, for each word, if the word should be
            preceded by a space.
          items:
            type: string
        targetWords:
          type: array
          description: >
            The target string can be constructed by suffixing each
            `targetDelimiters` entry with its corresponding word in
            `targetWords` and concatenating the constructed array.

            Please note that the `targetDelimiters` array has one more entry
            than `targetWords` array which is why the last entry in the array
            will be the last value of `targetDelimiters`.
          items:
            type: string
      description: >-
        A machine translation (MT) or a translation memory (TM) match of a
        source segment.
      example:
        - score: 3.4936864e-8
          align: 0-0 1-1 2-2 3-3
          targetDelimiters:
            - ''
            - ' '
            - ' '
            - ''
            - ''
          targetWords:
            - Authentifizierung
            - nicht
            - erforderlich
            - .
          target: Authentifizierung nicht erforderlich .
          targetWithTags: Authentifizierung nicht erforderlich.
          isTMMatch: false
          provenance: 0 0 0 0
  responses:
    UnauthorizedError:
      description: Unauthorized
      content:
        application/octet-stream:
          schema:
            type: string
        text/plain:
          schema:
            type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      name: key
      in: query

````