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

# Create model graph

> Creates a model graph visualization for a run, including nodes and edges.



## OpenAPI

````yaml /pluto/api-reference/openapi.json post /api/runs/modelGraph/create
openapi: 3.0.0
info:
  title: mlop API
  version: 1.0.0
  description: API for mlop - ML experiment tracking platform
servers:
  - url: https://pluto-api.trainy.ai
    description: API Server
security:
  - bearerAuth: []
paths:
  /api/runs/modelGraph/create:
    post:
      tags:
        - Runs
      summary: Create model graph
      description: >-
        Creates a model graph visualization for a run, including nodes and
        edges.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                runId:
                  type: number
                  description: Numeric ID of the run
                graph:
                  type: object
                  properties:
                    format:
                      type: string
                    nodes:
                      type: object
                      additionalProperties:
                        type: object
                        properties:
                          type:
                            type: string
                          depth:
                            type: integer
                          order:
                            type: integer
                          label:
                            type: string
                          node_id:
                            type: string
                          node_type:
                            type: string
                            enum:
                              - MODULE
                              - UNKNOWN
                              - CONTAINER
                              - IO
                          inst_id:
                            type: string
                          args:
                            type: array
                            items:
                              nullable: true
                          kwargs:
                            type: object
                            additionalProperties:
                              nullable: true
                          params:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: number
                          edges:
                            type: array
                            items:
                              type: array
                              items:
                                type: string
                        required:
                          - type
                          - depth
                  required:
                    - format
                    - nodes
                  description: Graph data with nodes and edges
              required:
                - runId
                - graph
      responses:
        '200':
          description: Model graph created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '404':
          description: Run not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Success:
      type: object
      properties:
        success:
          type: boolean
      required:
        - success
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key obtained from the mlop dashboard

````