ZenML Models API

Registered models and their versions

Documentation

Specifications

SDKs

Code Examples

Schemas & Data

Other Resources

OpenAPI Specification

zenml-models-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: ZenML OSS REST Artifacts Models API
  version: '1'
  description: REST API for the ZenML server, exposing operations to manage pipelines, stacks, components, artifacts, models, deployments, runs, schedules, secrets, users, projects, and triggers in a self-hosted ZenML deployment. The API is consumed by the ZenML Python SDK and CLI and can also be called directly for automation and CI/CD integration.
  contact:
    name: ZenML
    url: https://docs.zenml.io/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://your-zenml-server.example.com/api/v1
  description: ZenML server REST API (self-hosted)
security:
- bearerAuth: []
tags:
- name: Models
  description: Registered models and their versions
paths:
  /models:
    get:
      tags:
      - Models
      summary: List Models
      operationId: listModels
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/Size'
      responses:
        '200':
          description: Page of models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelPage'
    post:
      tags:
      - Models
      summary: Create Model
      operationId: createModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelRequest'
      responses:
        '201':
          description: Model created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
  /model_versions:
    get:
      tags:
      - Models
      summary: List Model Versions
      operationId: listModelVersions
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/Size'
      - in: query
        name: model_id
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Page of model versions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelVersionPage'
components:
  schemas:
    ModelVersionPage:
      allOf:
      - $ref: '#/components/schemas/Page'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/ModelVersion'
    Page:
      type: object
      properties:
        index:
          type: integer
        max_size:
          type: integer
        total_pages:
          type: integer
        total:
          type: integer
    ModelPage:
      allOf:
      - $ref: '#/components/schemas/Page'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/Model'
    Model:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        license:
          type: string
        ethical_considerations:
          type: string
        trade_offs:
          type: string
        limitations:
          type: string
        audience:
          type: string
        use_cases:
          type: string
        created:
          type: string
          format: date-time
    ModelRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
        description:
          type: string
        license:
          type: string
        use_cases:
          type: string
    ModelVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
        model_id:
          type: string
          format: uuid
        name:
          type: string
        number:
          type: integer
        stage:
          type: string
          enum:
          - none
          - staging
          - production
          - archived
        description:
          type: string
        created:
          type: string
          format: date-time
  parameters:
    Page:
      in: query
      name: page
      schema:
        type: integer
        minimum: 1
        default: 1
    Size:
      in: query
      name: size
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 20
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT