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
- dry_run: optional, only meaningful for action=configure or action=start — true returns a cost estimate without starting the training job (sends ?dryRun=true)
- team_id, project_id: required for OAuth callers
Returns: training-image updates, configuration payloads, or training state changes depending on the action you call. With dry_run=true on configure/start, returns a cost estimate without consuming credits.
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"
- "How much would this training cost?" -> action="start", model_id="model_xxx", dry_run=true
Don't use when: You want to run inference on an existing model. Prefer run_model instead.
open-world
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 | — | Asset IDs of pre-uploaded images (for upload_images). Pass the IDs returned by upload_asset, or existing asset_ids not raw URLs. |
| image_data | record | — | Metadata for update_image or pair mappings for set_pairs. |
| config | unknown | — | Training configuration (for configure). |
| dry_run | boolean | — | Estimate cost without running. Sends ?dryRun=true so Phoenix returns the cost estimate without starting the training job. Only meaningful for action=configure / action=start. |
| 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
JSON
{
"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
JSON
{
"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