---
updatedAt: 2025-09-22T20:35:01.000Z
agentTools:
  projectIndex: https://docs.v7labs.com/llms.txt
---

# Create TrainedModel

A TrainedModel is a record that holds a set of weights that can be loaded by a model when starting a RunningSession

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "wind",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://darwin.v7labs.com/ai"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/trained_models": {
      "post": {
        "summary": "Create TrainedModel",
        "description": "A TrainedModel is a record that holds a set of weights that can be loaded by a model when starting a RunningSession",
        "operationId": "create-trainedmodel",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model_template_id": {
                    "type": "string",
                    "description": "The ID of the associated ModelTemplate"
                  },
                  "name": {
                    "type": "string",
                    "description": "The name to be given to the newly created TrainedModel"
                  },
                  "weights_key": {
                    "type": "string",
                    "description": "The S3 key in which the weights file is stored"
                  },
                  "classes": {
                    "type": "string",
                    "description": "The list of annotation classes the model was trained on",
                    "default": "[]",
                    "format": "json"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "model_template_id": "c3995291-1e03-4b5f-b0b8-03b4e5c8d52f",
                    "name": "My TrainedModel",
                    "weights_key": "path/to/weights/weights.pth"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"classes\": [\n    {\n      \"display_name\": \"Cat\",\n      \"name\": \"1\",\n      \"type\": \"polygon\"\n    },\n    {\n      \"display_name\": \"Dog\",\n      \"name\": \"2\",\n      \"type\": \"polygon\"\n    }\n  ],\n  \"id\": \"aa36402e-6ad8-47d3-b121-d447fe2e80ed\",\n  \"inserted_at\": \"2020-10-01T13:20:16\",\n  \"name\": \"My TrainedModel\",\n  \"team_id\": 123,\n  \"weights_key\": \"path/to/weights/weights.pth\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "display_name": {
                            "type": "string",
                            "example": "Cat"
                          },
                          "name": {
                            "type": "string",
                            "example": "1"
                          },
                          "type": {
                            "type": "string",
                            "example": "polygon"
                          }
                        }
                      }
                    },
                    "id": {
                      "type": "string",
                      "example": "aa36402e-6ad8-47d3-b121-d447fe2e80ed"
                    },
                    "inserted_at": {
                      "type": "string",
                      "example": "2020-10-01T13:20:16"
                    },
                    "name": {
                      "type": "string",
                      "example": "My TrainedModel"
                    },
                    "team_id": {
                      "type": "integer",
                      "example": 123,
                      "default": 0
                    },
                    "weights_key": {
                      "type": "string",
                      "example": "path/to/weights/weights.pth"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```