Cancels a running fine-tuning job.
Cancel a fine-tuning job
For Windows CMD, replace${DASHSCOPE_API_KEY}with%DASHSCOPE_API_KEY%. For PowerShell, use$env:DASHSCOPE_API_KEY.
curl --location --request POST "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<your_job_id>/cancel" \
--header "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
--header 'Content-Type: application/json'
Input parameters
|
Parameter |
Type |
Parameter location |
Required |
Description |
|
job_id |
String |
Path |
Yes |
The ID of the fine-tuning job to cancel. You can obtain this ID from the response to a Create a fine-tuning job or List fine-tuning jobs API call. |
Response example
{
"request_id": "670fca9d-48dd-4c5a-83e7-33bcc20420f8",
"output": {
"status": "success"
}
}
Response parameters
|
Parameter |
Type |
Description |
|
request_id |
String |
The unique identifier for this request. |
|
output |
Object |
Details about the cancellation operation. |
Error codes
If an error occurs, the API returns the following response body.
|
Parameter |
Type |
Description |
Example |
|
code |
String |
The error code. |
NotFound |
|
request_id |
String |
The unique identifier for this request. |
6332fb02-3111-43f0-bf79-f9e8c5ffa7f9 |
|
message |
String |
The error message. |
Not Found! |
Error response example
{
"code": "NotFound",
"request_id": "BE213CDD-8A5C-59EE-9A67-055EAB0CB59B",
"message": "Not Found!"
}
List of error codes
|
HTTP status code |
Error code |
Error message example |
Description |
Solution |
|
400 |
InvalidParameter |
Missing training files |
A parameter is invalid because it is missing or has an incorrect format. |
Correct the parameters according to the error message. |
|
400 |
UnsupportedOperation |
The fine-tuning job cannot be canceled because it has already succeeded, failed, or been canceled. |
The operation cannot be performed because the resource is in a specific state. |
Wait for the resource to enter an appropriate state, then retry the operation. |
|
404 |
NotFound |
Not found! |
The requested resource does not exist. |
Check if the resource ID is correct. |
|
409 |
Conflict |
Model instance xxxxx already exists, please specify a suffix |
A deployed instance named 'xxxxx' already exists. You must specify a suffix to distinguish it. |
Specify a unique suffix for the deployment. |
|
429 |
Throttling |
|
The request rate has exceeded a platform limit. |
|
|
500 |
InternalError |
Internal server error! |
An internal error occurred. |
Record the request ID and submit a ticket to Alibaba Cloud for troubleshooting. |