train
ManagementTrain Models
Manage the custom model training lifecycle. Actions cover dataset upload, training-image updates, pair mapping, configuration, and start/stop controls. Args: - action: required — upload_images, update_image, delete_image, set_pairs, configure, start, or stop - model_id: required for every action - images: required for upload_images - training_image_id, image_data, config: required for the relevant update, pair, or configure actions - team_id, project_id: required for OAuth callers Returns: training-image updates, configuration payloads, or training state changes depending on the action you call. Examples: - "Upload training images" -> action="upload_images", model_id="model_xxx", images=["https://..."] - "Configure training" -> action="configure", model_id="model_xxx", config={"steps": 1200} - "Start training" -> action="start", model_id="model_xxx" Don't use when: You want to run inference on an existing model. Prefer run_model instead.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | enum(upload_images | update_image | delete_image | set_pairs | configure | start | stop) | ✓ | Training action: upload_images, update_image, delete_image, set_pairs, configure, start, or stop. |
| model_id | string | ✓ | Model ID (required for all training actions). |
| training_image_id | string | — | Training image ID (for update_image/delete_image). |
| images | array | — | Image URLs to upload (for upload_images). |
| image_data | record | — | Metadata for update_image or pair mappings for set_pairs. |
| config | unknown | — | Training configuration (for configure). |
| team_id | string | — | Team ID. Required if user belongs to multiple teams. |
| project_id | string | — | Project ID to scope the operation to. |
| response_format | enum(json | markdown) | json | Output format: 'json' for structured data, 'markdown' for human-readable text. |
Example Request
{
"action": "upload_images",
"model_id": "model_custom_abc",
"images": [
"https://cdn.example.com/ref1.png",
"https://cdn.example.com/ref2.png",
"https://cdn.example.com/ref3.png"
],
"team_id": "team_abc123",
"project_id": "proj_xyz789"
}Example Response
{
"status": "uploaded",
"count": 3
}Common Use Cases
- Upload reference images to a model before starting fine-tuning
- Configure training hyperparameters like steps and learning rate
- Start or stop a training job programmatically
- Set caption/description pairs for supervised style training