Train now
Trigger a training run on demand — and every reason the platform might say no.
Don't want to wait for the schedule? Queue a run immediately:
curl -X POST "$API_BASE/v1/pipelines/$PIPELINE_ID/train" \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workspace-Id: $WORKSPACE_ID"from predictai import PredictAI
client = PredictAI(token="pa_live_…", workspace_id="ws_…")
data = client.pipelines.post_pipelines_by_model_id_train(PIPELINE_ID)
import { PredictAI } from "@predictai/sdk";
const client = new PredictAI({ token: "pa_live_…", workspaceId: "ws_…" });
const data = await client.pipelines.postPipelinesByModelIdTrain(PIPELINE_ID);
{
"data": {
"uid": "9f2c41d8-…",
"manual_train_requested": true,
"message": "Training queued."
}
}There is no request body — the pipeline ID in the path is all it needs.
The 202 means the run is queued, not started — the training dispatcher
picks it up within seconds. Follow progress in
Trainings, or subscribe to the workspace's
realtime channel for training.job.* events.
If the pipeline lists several models in its model pool, the queued cycle trains all of them.
Pre-flight checks
The train call validates everything before queueing, so failures are immediate and actionable rather than silent:
| Status | Why | What to do |
|---|---|---|
404 | Pipeline not found, or not yours | Check the ID and workspace. |
409 | Pipeline is paused | Set active: true first. |
409 | A run is already in flight | Wait for it to complete. |
429 | Training concurrency or daily quota reached | Wait, or spread runs out. |
403 | Fine-tuning isn't in your plan (foundation pipelines) | Upgrade, or use zero-shot deployment instead. |
402 | Insufficient credits for an upfront-charged run | Top up, or lower training_intensity. |
{
"status": "Insufficient credits to start training (need 40, have 12). Top up your balance or pick a lower training intensity, then try again."
}What a run costs
Foundation trainings charge upfront based on
training_intensity. Custom-code trainings bill by elapsed compute after
the run. Estimate either kind before you spend with
POST /v1/billing/estimate.

