Lightly Embeddings API

Manage dataset embeddings and trigger 2D projection jobs.

OpenAPI Specification

lightly-ai-embeddings-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: LightlyOne Platform Datasets Embeddings API
  description: REST API for the LightlyOne data-curation and active-learning platform for computer vision. The API manages datasets, samples, embeddings, cloud datasources, selection / active-learning runs (the LightlyOne Worker), tags, and asynchronous jobs. Paths and verbs mirror the OpenAPI-generated client shipped inside the open-source `lightly` Python package (lightly.openapi_generated.swagger_client). The open-source self-supervised learning SDK is a separate, pip-installable library and is not part of this HTTP surface.
  termsOfService: https://www.lightly.ai/terms-of-service
  contact:
    name: Lightly Support
    email: support@lightly.ai
    url: https://www.lightly.ai
  license:
    name: Proprietary
    url: https://www.lightly.ai/terms-of-service
  version: '1.0'
servers:
- url: https://api.lightly.ai
  description: LightlyOne platform production API
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Embeddings
  description: Manage dataset embeddings and trigger 2D projection jobs.
paths:
  /v1/datasets/{datasetId}/embeddings:
    get:
      operationId: getEmbeddingsByDatasetId
      tags:
      - Embeddings
      summary: List embeddings for a dataset.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      responses:
        '200':
          description: A list of embeddings.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatasetEmbeddingData'
  /v1/datasets/{datasetId}/embeddings/{embeddingId}:
    delete:
      operationId: deleteEmbeddingById
      tags:
      - Embeddings
      summary: Delete an embedding by id.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      - $ref: '#/components/parameters/EmbeddingId'
      responses:
        '200':
          description: Deleted.
  /v1/datasets/{datasetId}/embeddings/writeCSVUrl:
    get:
      operationId: getEmbeddingsCSVWriteUrlById
      tags:
      - Embeddings
      summary: Get a signed URL to upload an embeddings CSV.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      - name: name
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A signed write URL and embedding id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteCSVUrlData'
  /v1/datasets/{datasetId}/embeddings/{embeddingId}/readCSVUrl:
    get:
      operationId: getEmbeddingsCSVReadUrl
      tags:
      - Embeddings
      summary: Get a signed URL to download an embeddings CSV.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      - $ref: '#/components/parameters/EmbeddingId'
      responses:
        '200':
          description: A signed read URL.
          content:
            application/json:
              schema:
                type: string
  /v1/datasets/{datasetId}/embeddings/{embeddingId}/trigger2dEmbeddingsJob:
    post:
      operationId: trigger2dEmbeddingsJob
      tags:
      - Embeddings
      summary: Trigger computation of a 2D projection of the embeddings.
      parameters:
      - $ref: '#/components/parameters/DatasetId'
      - $ref: '#/components/parameters/EmbeddingId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Trigger2dEmbeddingJobRequest'
      responses:
        '200':
          description: The triggered job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskData'
components:
  parameters:
    EmbeddingId:
      name: embeddingId
      in: path
      required: true
      schema:
        type: string
    DatasetId:
      name: datasetId
      in: path
      required: true
      schema:
        type: string
  schemas:
    AsyncTaskData:
      type: object
      properties:
        jobId:
          type: string
      required:
      - jobId
    DatasetEmbeddingData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        isProcessed:
          type: boolean
        createdAt:
          type: integer
          format: int64
      required:
      - id
      - name
    WriteCSVUrlData:
      type: object
      properties:
        embeddingId:
          type: string
        signedWriteUrl:
          type: string
      required:
      - embeddingId
      - signedWriteUrl
    Trigger2dEmbeddingJobRequest:
      type: object
      properties:
        dimensionalityReductionMethod:
          type: string
          enum:
          - PCA
          - TSNE
          - UMAP
      required:
      - dimensionalityReductionMethod
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: LightlyOne API token passed as the `token` query parameter. Find your token in the preferences menu of the LightlyOne Platform.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Public JWT bearer token passed in the `Authorization: Bearer <token>` header for browser / public-token authenticated calls.'