The Models API provides endpoints for creating, managing, and using machine learning models on the Plexe Platform.
Models Endpoints
List Models
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Retrieves a list of all models in your account.
Query Parameters
Parameter | Type | Required | Description |
---|
limit | integer | No | Maximum number of models to return (default: 20, max: 100) |
offset | integer | No | Number of models to skip (default: 0) |
status | string | No | Filter by status: DRAFT , BUILDING , READY , ERROR |
sort_by | string | No | Field to sort by: created_at , name (default: created_at ) |
sort_dir | string | No | Sort direction: asc or desc (default: desc ) |
Response
Get Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Retrieves detailed information about a specific model.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to get |
Response
Create Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Initiates the process of building a new model. This is an asynchronous operation that returns a job ID for tracking progress.
Request Body
Field | Type | Required | Description |
---|
intent | string | Yes | Natural language description of the model purpose |
name | string | No | Display name for the model (default: generated) |
description | string | No | Detailed description of the model |
dataset_id | string | Yes | ID of the dataset to use for training |
input_schema | object | No | Schema of input fields (inferred if not provided) |
output_schema | object | No | Schema of output fields (inferred if not provided) |
tags | array | No | List of tags for organizing models |
Response
Deploy Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Deploys a model, making it available for predictions. This is an asynchronous operation.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to deploy |
Request Body
Field | Type | Required | Description |
---|
environment | string | No | Deployment environment (default: production ) |
replicas | integer | No | Number of replicas to deploy (default: 1) |
auto_scale | boolean | No | Whether to enable auto-scaling (default: true ) |
Response
Make Prediction
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Makes a prediction using a deployed model.
Path Parameters
Parameter | Type | Required | Description |
---|
deployment_id | string | Yes | ID of the deployed model to use |
Request Body
Input data matching the model’s input schema. Example:
Response
Output data matching the model’s output schema. Example:
Update Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Updates metadata for an existing model.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to update |
Request Body
Field | Type | Required | Description |
---|
name | string | No | New display name for the model |
description | string | No | New description of the model |
tags | array | No | Updated list of tags |
Response
Delete Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Deletes a model and its deployments.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to delete |
Response
Model Versions
List Model Versions
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Lists all versions of a specific model.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to list versions for |
Response
Create Model Version
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Creates a new version of an existing model. This is useful for iterative model improvement.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to create version for |
Request Body
Field | Type | Required | Description |
---|
dataset_id | string | Yes | ID of the dataset to use for training |
intent | string | No | Updated intent (defaults to original if omitted) |
input_schema | object | No | Updated input schema (defaults to original) |
output_schema | object | No | Updated output schema (defaults to original) |
Response
Model Deployments
List Deployments
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Lists all active deployments for a model.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to list deployments for |
Response
Undeploy Model
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Removes a specific deployment of a model.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model |
deployment_id | string | Yes | ID of the deployment to remove |
Response
Batch Predictions
Create Batch Prediction Job
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Content-Type | application/json | Required |
Creates a batch prediction job for processing multiple inputs at once.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model to use for prediction |
Request Body
Field | Type | Required | Description |
---|
dataset_id | string | Yes | ID of the dataset containing inputs |
output_format | string | No | Format for results: json or csv (default: json ) |
include_explanations | boolean | No | Whether to include prediction explanations |
Response
Get Batch Prediction Results
Header | Value | Description |
---|
Authorization | Bearer TOKEN | Required. Your API access token |
Retrieves the status and results of a batch prediction job.
Path Parameters
Parameter | Type | Required | Description |
---|
model_id | string | Yes | ID of the model used for prediction |
batch_job_id | string | Yes | ID of the batch prediction job |
Response
Error Codes
HTTP Status | Error Code | Description |
---|
400 | invalid_request | Malformed request or missing parameters |
401 | unauthorized | Missing or invalid API key |
403 | forbidden | Insufficient permissions for operation |
404 | not_found | Model, deployment, or resource not found |
409 | conflict | Resource conflict (e.g., duplicate name) |
422 | validation_error | Invalid input data or schema |
429 | rate_limit_exceeded | API rate limit exceeded |
500 | internal_error | Server-side error |
503 | service_unavailable | Service temporarily unavailable |
For all API errors, the response will include details about the error and, where appropriate, suggestions for resolution.