> For the complete documentation index, see [llms.txt](https://docs.epic-ai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.epic-ai.com/api-dokumentation/chatbot-models.md).

# Chatbot Models

## Lists all trained models for a chatbot

> \
> \
> \*\*Required Permission:\*\* \`chatbots.models.list\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot models","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/models":{"get":{"operationId":"ChatbotModelController_listModels[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}}],"responses":{"200":{"description":"List of all models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListModelsResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Lists all trained models for a chatbot","tags":["Chatbot models"],"description":"\n\n**Required Permission:** `chatbots.models.list`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ListModelsResponseDto":{"type":"object","properties":{"models":{"description":"A list of models.","type":"array","items":{"$ref":"#/components/schemas/ModelDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["models"]},"ModelDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the model."},"name":{"type":"string","description":"The name of the model."},"created":{"type":"string","description":"The creation timestamp of the model."},"updated":{"type":"string","description":"The last update timestamp of the model."},"trainingStatus":{"description":"The training status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"evaluationStatus":{"description":"The evaluation status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"estimatedEndDateTime":{"type":"string","description":"The estimated end time of the current process."},"cluJobId":{"type":"string","description":"The job ID from the CLU service."},"trainingMode":{"type":"string","description":"The training mode used for the model."},"state":{"type":"string","description":"The current state of the model."},"cluModelId":{"type":"string","description":"The model ID from the CLU service."},"lastTrainingDurationInSeconds":{"type":"number","description":"The duration of the last training in seconds."},"lastTrainedDateTime":{"type":"string","description":"The timestamp of the last training."},"expirationDate":{"type":"string","description":"The expiration date of the model."},"modelTrainingConfigVersion":{"type":"string","description":"The version of the model training configuration."},"enoughExamples":{"type":"boolean","description":"Indicates if there are enough examples for training."}},"required":["id","name","created","updated","trainingStatus","evaluationStatus","cluJobId","trainingMode","state"]},"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## Retrieves a specific trained model

> \
> \
> \*\*Required Permission:\*\* \`chatbots.models.get\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot models","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/models/{modelId}":{"get":{"operationId":"ChatbotModelController_getModel[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"modelId","required":true,"in":"path","description":"The ID of the model to be retrieved.","schema":{"type":"string"}}],"responses":{"200":{"description":"Details of the model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetModelResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Retrieves a specific trained model","tags":["Chatbot models"],"description":"\n\n**Required Permission:** `chatbots.models.get`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"GetModelResponseDto":{"type":"object","properties":{"model":{"description":"The retrieved model.","nullable":true,"allOf":[{"$ref":"#/components/schemas/ModelDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["model"]},"ModelDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the model."},"name":{"type":"string","description":"The name of the model."},"created":{"type":"string","description":"The creation timestamp of the model."},"updated":{"type":"string","description":"The last update timestamp of the model."},"trainingStatus":{"description":"The training status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"evaluationStatus":{"description":"The evaluation status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"estimatedEndDateTime":{"type":"string","description":"The estimated end time of the current process."},"cluJobId":{"type":"string","description":"The job ID from the CLU service."},"trainingMode":{"type":"string","description":"The training mode used for the model."},"state":{"type":"string","description":"The current state of the model."},"cluModelId":{"type":"string","description":"The model ID from the CLU service."},"lastTrainingDurationInSeconds":{"type":"number","description":"The duration of the last training in seconds."},"lastTrainedDateTime":{"type":"string","description":"The timestamp of the last training."},"expirationDate":{"type":"string","description":"The expiration date of the model."},"modelTrainingConfigVersion":{"type":"string","description":"The version of the model training configuration."},"enoughExamples":{"type":"boolean","description":"Indicates if there are enough examples for training."}},"required":["id","name","created","updated","trainingStatus","evaluationStatus","cluJobId","trainingMode","state"]},"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## Retrieves evaluation results for a specific model

> \
> \
> \*\*Required Permission:\*\* \`chatbots.models.get\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot models","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/models/{modelId}/evaluation":{"get":{"operationId":"ChatbotModelController_getModelEvaluation[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"modelId","required":true,"in":"path","description":"The ID of the model to be evaluated.","schema":{"type":"string"}}],"responses":{"200":{"description":"Detailed evaluation metrics of the model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetModelEvaluationResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Retrieves evaluation results for a specific model","tags":["Chatbot models"],"description":"\n\n**Required Permission:** `chatbots.models.get`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"GetModelEvaluationResponseDto":{"type":"object","properties":{"evaluation":{"description":"The evaluation of the model.","allOf":[{"$ref":"#/components/schemas/ModelEvaluationDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ModelEvaluationDto":{"type":"object","properties":{"projectKind":{"type":"string","description":"The kind of the project."},"distribution":{"description":"The distribution of data.","allOf":[{"$ref":"#/components/schemas/DistributionDto"}]},"entitiesEvaluation":{"description":"The evaluation of entities.","allOf":[{"$ref":"#/components/schemas/EntitiesEvaluationDto"}]},"evaluationOptions":{"description":"The options used for evaluation.","allOf":[{"$ref":"#/components/schemas/EvaluationOptionsDto"}]},"intentsEvaluation":{"description":"The evaluation of intents.","allOf":[{"$ref":"#/components/schemas/IntentsEvaluationDto"}]},"modelGuidance":{"type":"object","description":"Detailed guidelines for model improvement."}},"required":["projectKind","distribution","entitiesEvaluation","evaluationOptions","intentsEvaluation","modelGuidance"]},"DistributionDto":{"type":"object","properties":{"labelsDistribution":{"description":"The overall distribution of labels.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"entities":{"description":"The evaluation distribution for each entity.","type":"array","items":{"$ref":"#/components/schemas/EntityCluEvaluationDto"}},"intents":{"description":"The evaluation distribution for each intent.","type":"array","items":{"$ref":"#/components/schemas/IntentCluEvaluationDto"}}},"required":["labelsDistribution","entities","intents"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]},"EntityCluEvaluationDto":{"type":"object","properties":{"entityName":{"type":"string","description":"The name of the entity."},"labelsDistribution":{"description":"The distribution of labels for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"examplesDistribution":{"description":"The distribution of examples for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["entityName","labelsDistribution","examplesDistribution"]},"IntentCluEvaluationDto":{"type":"object","properties":{"intentName":{"type":"string","description":"The name of the intent."},"labelsDistribution":{"description":"The distribution of labels for this intent.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["intentName","labelsDistribution"]},"EntitiesEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for entities.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"entities":{"type":"object","description":"The evaluation metrics for each entity.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","entities","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]},"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]},"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]},"EvaluationOptionsDto":{"type":"object","properties":{"kind":{"type":"string","description":"The kind of evaluation."},"trainingSplitPercentage":{"type":"number","description":"The percentage of data used for training."},"testSplitPercentage":{"type":"number","description":"The percentage of data used for testing."}},"required":["kind","trainingSplitPercentage","testSplitPercentage"]},"IntentsEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for intents.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"intents":{"type":"object","description":"The evaluation metrics for each intent.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","intents","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]}}}}
```
