Anaconda Models API

The Models API from Anaconda — 5 operation(s) for models.

OpenAPI Specification

anaconda-models-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Anaconda Models API
  version: 1.0.0
  description: 'Operations tagged Models across 2 of this provider''s published API definitions: anaconda-ai-navigator-openapi-original.json, anaconda-desktop-openapi-original.json. Each path carries the servers of the definition it was published in.'
security:
- bearerAuth: []
tags:
- name: Models
paths:
  /api/models/health:
    get:
      summary: Check the health of the models API
      tags:
      - Models
      responses:
        '200':
          description: Models API is healthy
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: /api/models/health ok
  /api/models:
    get:
      summary: Get all models
      description: Retrieves a list of models, either from the entire catalog or only those downloaded locally
      tags:
      - Models
      parameters:
      - in: query
        name: downloaded
        schema:
          type: boolean
        description: When true, returns only models that have at least one file downloaded locally
      responses:
        '200':
          description: List of models retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ModelSummary'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/models/{id}:
    get:
      summary: Get model details by ID
      description: Retrieves detailed information about a specific model, including its metadata and files
      tags:
      - Models
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
        description: ID of the model to retrieve
      responses:
        '200':
          description: Model details retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Unique identifier for the model
                      name:
                        type: string
                        description: Name of the model
                      metadata:
                        type: object
                        properties:
                          numParameters:
                            type: number
                            description: Number of parameters in the model
                          contextWindowSize:
                            type: number
                            description: Maximum context window size in tokens
                          trainedFor:
                            $ref: '#/components/schemas/TrainedFor'
                          description:
                            type: string
                            description: Detailed description of the model
                          license:
                            type: string
                            description: License under which the model is distributed
                          languages:
                            type: array
                            items:
                              type: string
                            description: Languages supported by the model
                          last_updated:
                            type: string
                            format: date-time
                            description: Date when the model was last updated
                          library_name:
                            type: string
                            description: Library or framework the model is designed for
                          model_type:
                            type: string
                            description: Type or architecture of the model
                          resources:
                            type: object
                            properties:
                              canonicalUrl:
                                type: string
                                description: Official URL for the model
                              paperUrl:
                                type: string
                                description: URL to the research paper associated with the model
                          publisher:
                            type: string
                            description: Publisher or organization that released the model
                          files:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  description: Unique identifier for the model file
                                name:
                                  type: string
                                  description: Name of the model file
                                downloadUrl:
                                  type: string
                                  description: URL to download the model file
                                sizeBytes:
                                  type: number
                                  description: Size of the model file in bytes
                                sha256checksum:
                                  type: string
                                  description: SHA-256 hash of the model file for integrity verification
                                quantization:
                                  type: string
                                  description: Quantization method used for the model
                                format:
                                  type: string
                                  description: File format of the model
                                maxRamUsage:
                                  type: number
                                  description: Maximum RAM required to run the model in bytes
                                isDownloaded:
                                  type: boolean
                                  description: Whether the model file has been downloaded locally
                                localPath:
                                  type: string
                                  description: Local file system path where the model is stored
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /models/{modelId}/files:
    get:
      summary: List all files for a specific model
      tags:
      - Models
      parameters:
      - in: path
        name: modelId
        required: true
        schema:
          type: string
        description: ID of the model
      - in: query
        name: downloaded
        schema:
          type: boolean
        description: Filter to only show downloaded files
      responses:
        '200':
          description: List of model files retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ModelFile'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/models/{modelId}/files/{fileId}:
    get:
      summary: Get details of a specific model file
      tags:
      - Models
      parameters:
      - in: path
        name: modelId
        required: true
        schema:
          type: string
        description: ID of the model
      - in: path
        name: fileId
        required: true
        schema:
          type: string
        description: ID of the file
      responses:
        '200':
          description: Model file details retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ModelFile'
        '404':
          description: Model or file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update download status of a model file
      tags:
      - Models
      parameters:
      - in: path
        name: modelId
        required: true
        schema:
          type: string
        description: ID of the model
      - in: path
        name: fileId
        required: true
        schema:
          type: string
        description: ID of the file
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadAction'
      responses:
        '200':
          description: Download status updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadStatus'
        '400':
          description: Invalid action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model or file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete a model file
      tags:
      - Models
      parameters:
      - in: path
        name: modelId
        required: true
        schema:
          type: string
        description: ID of the model
      - in: path
        name: fileId
        required: true
        schema:
          type: string
        description: ID of the file
      responses:
        '200':
          description: File deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
        '404':
          description: Model or file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ModelFile:
      type: object
      required:
      - id
      - name
      - downloadUrl
      - sizeBytes
      - sha256checksum
      - quantization
      - format
      - maxRamUsage
      properties:
        id:
          type: string
          description: Unique identifier for the model file
        name:
          type: string
          description: Name of the model file
        downloadUrl:
          type: string
          description: URL to download the model file
        sizeBytes:
          type: number
          description: Size of the model file in bytes
        sha256checksum:
          type: string
          description: SHA-256 hash of the model file for integrity verification
        quantization:
          type: string
          description: Quantization method used for the model
        format:
          type: string
          description: File format of the model
        isDownloaded:
          type: boolean
          description: Whether the model file has been downloaded locally
        maxRamUsage:
          type: number
          description: Maximum RAM required to run the model in bytes
        downloadStatus:
          type: object
          description: Information about the download status of the file
          properties:
            status:
              type: string
              enum:
              - not_started
              - in_progress
              - paused
              - completed
              description: Current status of the download
            progress:
              $ref: '#/components/schemas/Download'
            localPath:
              type: string
              description: Local path where the file is stored (only when status is completed)
    TrainedFor:
      type: string
      enum:
      - text-generation
      - sentence-similarity
      description: The primary task the model was trained for
    DownloadAction:
      type: object
      required:
      - action
      properties:
        action:
          type: string
          enum:
          - start
          - pause
          - resume
          description: Action to perform on the download
    DownloadStatus:
      type: object
      required:
      - data
      properties:
        data:
          type: object
          required:
          - status
          properties:
            status:
              type: string
              enum:
              - in_progress
              - paused
              - completed
              description: Current status of the download
            progress:
              $ref: '#/components/schemas/Download'
              description: Download progress information (only when status is in_progress or paused)
            localPath:
              type: string
              description: Local path where the file is stored (only when status is completed)
    Download:
      type: object
      required:
      - fileId
      - modelId
      - filename
      - downloadedRatio
      - transferredBytes
      - totalBytes
      - paused
      - downloadTimeTaken
      - averageMbps
      properties:
        fileId:
          type: string
          description: ID of the file being downloaded
        modelId:
          type: string
          description: ID of the model being downloaded
        filename:
          type: string
          description: Name of the file being downloaded
        downloadedRatio:
          type: number
          description: Percentage of download completion (0-1)
        transferredBytes:
          type: number
          description: Number of bytes transferred
        totalBytes:
          type: number
          description: Total size of the file in bytes
        paused:
          type: boolean
          description: Whether the download is paused
        downloadTimeTaken:
          type: number
          description: Time taken for download in milliseconds
        averageMbps:
          type: number
          description: Average download speed in Mbps
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
              - INVALID_REQUEST
              - DATABASE_NOT_RUNNING
              - INTERNAL_SERVER_ERROR
              - INVALID_SERVER_ID
              - SERVER_NOT_RUNNING
              - SERVER_RUNNING
              - INTERNAL_SERVER_ERROR
            message:
              type: string
    ModelSummary:
      type: object
      required:
      - id
      - name
      - metadata
      properties:
        id:
          type: string
          description: Unique identifier for the model
        name:
          type: string
          description: Name of the model
        metadata:
          type: object
          required:
          - numParameters
          - trainedFor
          - description
          - quantizations
          properties:
            numParameters:
              oneOf:
              - type: number
              - type: string
              description: Number of parameters in the model (string for legacy models)
            contextWindowSize:
              type: number
              description: Maximum context window size for the model
            trainedFor:
              type: string
              description: Primary task the model was trained for
            description:
              type: string
              description: Description of the model
            quantizations:
              type: array
              items:
                type: object
                required:
                - modelFileName
                - method
                - sizeBytes
                - maxRamUsage
                properties:
                  modelFileName:
                    type: string
                    description: Name of the model file
                  method:
                    type: string
                    description: Quantization method used
                  sizeBytes:
                    type: number
                    description: Size of the quantized model in bytes
                  maxRamUsage:
                    type: number
                    description: Maximum RAM usage of the quantized model
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: Enter your API key here
x-refined-from:
- anaconda-ai-navigator-openapi-original.json
- anaconda-desktop-openapi-original.json