curl -X POST https://platform.u1.archetypeai.app/api/fine-tuning/jobs/your-job-id/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "your-job-id"
response = requests.post(
f"https://platform.u1.archetypeai.app/api/fine-tuning/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
print(response.json())
const jobId = 'your-job-id';
const response = await fetch(
`https://platform.u1.archetypeai.app/api/fine-tuning/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const data = await response.json();
console.log(data);
{
"object": "fine_tuning.job",
"id": "your-job-id",
"name": "my-tune",
"model": "newton",
"created_at": 1765201323,
"org_id": "your-org",
"status": "CANCELLED",
"checkpoint_id": null,
"fine_tuned_model": null,
"finished_at": 1765201999,
"outcome": null,
"seed": 42,
"user_provided_suffix": "v2",
"training_files": ["fil_..."],
"validation_files": ["fil_..."],
"errors": []
}
{
"code": "not_found",
"message": "Not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
{
"code": "invalid_state_transition",
"message": "Invalid state transition",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
Fine-Tuning Service
Cancel Fine-tuning Job
Cancel a fine-tuning job
POST
/
fine-tuning
/
jobs
/
{id}
/
cancel
curl -X POST https://platform.u1.archetypeai.app/api/fine-tuning/jobs/your-job-id/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "your-job-id"
response = requests.post(
f"https://platform.u1.archetypeai.app/api/fine-tuning/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
print(response.json())
const jobId = 'your-job-id';
const response = await fetch(
`https://platform.u1.archetypeai.app/api/fine-tuning/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const data = await response.json();
console.log(data);
{
"object": "fine_tuning.job",
"id": "your-job-id",
"name": "my-tune",
"model": "newton",
"created_at": 1765201323,
"org_id": "your-org",
"status": "CANCELLED",
"checkpoint_id": null,
"fine_tuned_model": null,
"finished_at": 1765201999,
"outcome": null,
"seed": 42,
"user_provided_suffix": "v2",
"training_files": ["fil_..."],
"validation_files": ["fil_..."],
"errors": []
}
{
"code": "not_found",
"message": "Not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
{
"code": "invalid_state_transition",
"message": "Invalid state transition",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
Requires version 1.1.5 or later of the Archetype platform.
Overview
Cancel a fine-tuning job. Force-stops the run (worker pods are killed without a final checkpoint) and tears down its resources. A cancelled job cannot be resumed; use the Pause Job endpoint for a graceful, resumable stop instead.Request
A TypeID-encoded identifier with the
FineTuningJobId prefix, which identifies the
fine-tuning job.Response
Returns a description of the fine-tuning job after cancellation.The job’s current lifecycle stage. One of
PENDING, ADMITTED, RUNNING, COMPLETED,
FAILED, PREEMPTED, CANCELLED, PAUSED, INTERRUPTED. To determine whether a
COMPLETED job was fully or partially successful, or produced no output, see the value of the
outcome property.Always
null for cancelled jobs. This property does not take on a value until and unless the job’s
status is COMPLETED. v1.1.5+Failure detail when the job has failed, as the platform error envelope (a list of
{code, message, suggestion, error_uid}). Empty while the job is queued/running or on success. See
Error Handling for information about handling platform errors.The name of the model produced by the job. This is available once training has succeeded but is
null until then.The Unix timestamp (in seconds) at which the job finished, or
null if it is not yet complete.For a
COMPLETED job, this string indicates whether it succeeded fully (SUCCESS), partially (PARTIAL), or produced nothing (FAILED); null for any non-completed status.curl -X POST https://platform.u1.archetypeai.app/api/fine-tuning/jobs/your-job-id/cancel \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
job_id = "your-job-id"
response = requests.post(
f"https://platform.u1.archetypeai.app/api/fine-tuning/jobs/{job_id}/cancel",
headers={"Authorization": f"Bearer {api_key}"}
)
print(response.json())
const jobId = 'your-job-id';
const response = await fetch(
`https://platform.u1.archetypeai.app/api/fine-tuning/jobs/${jobId}/cancel`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const data = await response.json();
console.log(data);
{
"object": "fine_tuning.job",
"id": "your-job-id",
"name": "my-tune",
"model": "newton",
"created_at": 1765201323,
"org_id": "your-org",
"status": "CANCELLED",
"checkpoint_id": null,
"fine_tuned_model": null,
"finished_at": 1765201999,
"outcome": null,
"seed": 42,
"user_provided_suffix": "v2",
"training_files": ["fil_..."],
"validation_files": ["fil_..."],
"errors": []
}
{
"code": "not_found",
"message": "Not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
{
"code": "invalid_state_transition",
"message": "Invalid state transition",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
Was this page helpful?