> ## 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.

# Create an API key

> Mint a new `lilt_*` API key under the caller's current organization. Requires the `apiKey.write` permission.

The plaintext secret is returned in the `key` field of the response and is shown exactly once — store it securely, as it cannot be retrieved again. The optional `userId` lets an admin create a key on behalf of another user who already has a grant in the current organization.




## OpenAPI

````yaml /api-reference/openapi-bundled.yaml post /v2/api-keys
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/api-keys:
    post:
      tags:
        - API Keys
      summary: Create an API key
      description: >
        Mint a new `lilt_*` API key under the caller's current organization.
        Requires the `apiKey.write` permission.


        The plaintext secret is returned in the `key` field of the response and
        is shown exactly once — store it securely, as it cannot be retrieved
        again. The optional `userId` lets an admin create a key on behalf of
        another user who already has a grant in the current organization.
      operationId: createApiKey
      requestBody:
        required: true
        description: API key creation parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
      responses:
        '201':
          description: >-
            The created API key, including the plaintext secret (shown once
            only).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyWithSecret'
        '400':
          description: >-
            Invalid request. Causes include: `expiresAt` is not a future
            ISO-8601 timestamp; the target `userId` has no grant in the
            organization; `name` is missing, empty, or longer than 255
            characters; an unrecognized field was sent; or the authenticated
            user has no active organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyError'
        '401':
          description: The request is not authenticated.
        '403':
          description: The caller does not hold `apiKey.write` on the current organization.
        default:
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateApiKeyRequest:
      type: object
      description: Request body for creating a new API key.
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: A human-readable label for the key (1–255 characters).
          example: CI bot
        expiresAt:
          type: string
          format: date-time
          description: >-
            Optional ISO-8601 expiry timestamp. Must be in the future. Omit for
            a non-expiring key.
          example: '2027-01-01T00:00:00Z'
        userId:
          type: integer
          minimum: 1
          description: >-
            Optional. When provided by an admin, mints the key on behalf of this
            user. The target user must already have a grant in the current
            organization. Defaults to the authenticated caller.
          example: 42
    ApiKeyWithSecret:
      type: object
      description: >-
        A newly created or rotated API key, including the plaintext secret. The
        secret is shown exactly once and cannot be retrieved again. Note that
        `lastUsedAt` and `revokedAt` are not returned by the create and rotate
        operations.
      required:
        - id
        - name
        - prefix
        - key
        - createdAt
      properties:
        id:
          type: string
          description: The unique identifier for the API key.
          example: uuid-1234
        name:
          type: string
          description: A human-readable label for the key.
          example: CI bot
        prefix:
          type: string
          description: >-
            The first 8 characters of the key's random portion — the part that
            follows the `lilt_` prefix. Safe to display.
          example: aaaaaaaa
        key:
          type: string
          description: >-
            The full plaintext API key (`lilt_` followed by 40 hex characters).
            Shown once only.
          example: lilt_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        createdAt:
          type: string
          format: date-time
          description: ISO-8601 timestamp when the key was created.
          example: '2026-04-29T00:00:00Z'
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO-8601 timestamp when the key expires, or null if it does not
            expire.
          example: '2027-01-01T00:00:00Z'
        ownerEmail:
          type: string
          nullable: true
          description: >-
            Email address of the user who owns the key. Returned when creating a
            key; omitted when rotating one.
          example: developer@lilt.com
        ownerUserId:
          type: integer
          nullable: true
          description: >-
            Numeric identifier of the user who owns the key. Returned when
            creating a key; omitted when rotating one.
          example: 42
    ApiKeyError:
      type: object
      description: >-
        Error response returned by the API Keys endpoints. The human-readable
        message is carried in the `error` field.
      properties:
        error:
          type: string
          description: A human-readable message describing the error.
          example: No active organization
    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.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      name: key
      in: query

````