Skip to main content

Query fine-tuning task details

Query the details of a specific model fine-tuning task.

Prerequisites

Query fine-tuning job status

Query the detailed information and running status of a specified fine-tuning job.

Endpoint

GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}

Request example

curl --location --request GET "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为您的调优任务id>" \
      --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
      --header 'Content-Type: application/json'

Request parameters

Field

Type

Parameter passing

Required

Description

job_id

String

Url Path

Yes

The ID of the fine-tuning job to query. It is the job_id in the response parameters for creating a fine-tuning job.

Response example

  • Text generation model
  • Video generation model
  • Image generation model
{
    "request_id": "c59b2145-a93c-4e00-b610-4d7cc5c521a2",
    "output": {
        "job_id": "ft-202410291653-1c7f",
        "job_name": "ft-202410291653-1c7f",
        "status": "SUCCEEDED",
        "finetuned_output": "qwen3-14b-suffix-ft-202410291653-1c7f",
        "model": "qwen3-14b",
        "base_model": "qwen3-14b",
        "training_file_ids": [],
        "validation_file_ids": [],
        "training_datasets": [
            {
                "data_source_type": "file_id",
                "file_id": "976bd01a-f30b-4414-86fd-50c54486e3ef"
            }
        ],
        "validation_datasets": [],
        "hyper_parameters": {
            "n_epochs": 3,
            "batch_size": 32,
            "max_length": 8192,
            "learning_rate": "1.6e-5",
            "lr_scheduler_type": "linear",
            "split": 0.9
        },
        "training_type": "sft",
        "create_time": "2024-10-29 16:53:53",
        "workspace_id": "llm-v71tlv***",
        "user_identity": "1396993924585947",
        "modifier": "1396993924585947",
        "creator": "1396993924585947",
        "end_time": "2024-10-29 17:11:26",
        "group": "llm",
        "usage": 279808
    }
}

Response parameters

Parameter Name

Type

Description

request_id

String

The ID of the request.

output

Object

The details of the fine-tuning job.

output.job_id

String

The ID of the fine-tuning job. You can use this ID to query the job status later.

Generation rule: ft-{yyyyMMddHHmm}-{4-digit uuid}.

output.jobs_name

String

Same as output.job_id.

output.status

String

The job status of this fine-tuning job.

output.finetuned_output

String

This parameter appears only when the fine-tuning job status is SUCCEED. It returns the ID of the fine-tuned model.

output.model

String

The ID of the model used for the fine-tuning job.

output.base_model

String

The ID of the foundation model that corresponds to the model used for the fine-tuning job.

For example, the foundation model used by the fine-tuning job ft-202410291653-1c7f is qwen3-14b.

output.training_file_ids

Array

A field for compatibility. New jobs always return an empty array. Use training_datasets instead.

output.validation_file_ids

Array

A field for compatibility. New jobs always return an empty array. Use validation_datasets instead.

output.training_datasets

Array of Dataset

A list of training datasets.

output.validation_datasets

Array of Dataset

A list of test datasets.

output.hyper_parameters

Object

The explicitly declared hyperparameters.

output.training_type

String

The fine-tuning method.

output.create_time

String

The time when the fine-tuning job was created.

output.workspace_id

String

The ID of the workspace to which the fine-tuning job belongs.

output.user_identity

String

The UID of the primary account to which the fine-tuning job belongs.

output.modifier

String

The UID of the account that last operated on the fine-tuning job. (For example, if a RAM user cancels the job, the UID of the RAM user is displayed here.)

output.creator

String

The UID of the user who created the fine-tuning job.

output.end_time

String

The time when the fine-tuning job ended. This parameter appears when the job status is SUCCEED, FAILED, or CANCELED.

output.group

String

The task type of the model fine-tuning.

output.usage

Integer

The number of tokens (count) consumed by the fine-tuning job. For the billing formula, see Billing. This parameter appears when the job status is SUCCEED or CANCELED.

output.output_cnt

Integer

The number of Checkpoints that the current job has generated. This parameter is returned only for models that support multiple Checkpoint outputs (such as cosyvoice-v3-flash). You can obtain the detailed list of Checkpoints by calling the Query Checkpoint operation.

output.max_output_cnt

Integer

The maximum number of Checkpoints that a single job can generate. The part of output_cnt that exceeds this limit is truncated based on the fine-tuning sufficiency. This parameter is returned only for models that support multiple Checkpoint outputs.

Cancel a fine-tuning job

Cancels a running fine-tuning job. Only jobs in the running state can be canceled.

Endpoint

POST https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/cancel

Request example

curl --location --request POST "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为您的调优任务id>/cancel" \
      --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
      --header 'Content-Type: application/json'

Request parameters

Field

Type

Parameter passing

Required

Description

job_id

String

Url Path

Yes

The ID of the fine-tuning job to cancel. You can obtain this ID by calling the create training job or list training jobs operation.

Response example

{
    "request_id": "670fca9d-48dd-4c5a-83e7-33bcc20420f8",
    "output": {
        "status": "success"
    }
}

Response parameters

Parameter Name

Type

Description

request_id

String

The ID of the request.

output

Object

The details returned for the cancel operation.

Delete a fine-tuning job

Deletes the record of a specified fine-tuning job.

Endpoint

DELETE https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}

Request example

curl --location --request DELETE "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为您的调优任务id>" \
      --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
      --header 'Content-Type: application/json'

Request parameters

Field

Type

Parameter passing

Required

Description

job_id

String

Url Path

Yes

The ID of the fine-tuning job to delete. You can obtain this ID by calling the create training job or list training jobs operation.

Response example

{
    "request_id": "7d7e1469-df77-4163-83ce-54425df744ed",
    "output": {
        "status": "success"
    }
}

Response parameters

Parameter Name

Type

Description

request_id

String

The ID of the request.

output

Object

The details returned for the delete operation.

Query the list of fine-tuning jobs

Queries the list of fine-tuning jobs under the current account in a paginated manner.

Endpoint

GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes

Request example

curl --location --request GET "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes?model=qwen3-14b&page_no=2" \
      --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
      --header 'Content-Type: application/json'

Request parameters

Parameter Name

Type

Parameter passing

Required

Description

page_no

Integer

Query

No

Default value: 1.

page_size

Integer

Query

No

Default value: 10. Maximum: 1000. Minimum: 1.

model

String

Query

No

The model ID. If you specify this parameter, only fine-tuning jobs based on this model are listed.

Response example

{
    "request_id": "2182ef64-6398-457b-b3f6-5fde5fd6b388",
    "output": {
        "page_no": 2,
        "page_size": 10,
        "total": 12,
        "jobs": [
            {
                "job_id": "ft-202410291653-1c7f",
                "job_name": "ft-202410291653-1c7f",
                "status": "SUCCEEDED",
                "finetuned_output": "qwen3-14b-suffix-ft-202410291653-1c7f",
                "model": "qwen3-14b",
                "base_model": "qwen3-14b",
                "training_file_ids": [],
                "validation_file_ids": [],
                "training_datasets": [
                    {
                        "data_source_type": "file_id",
                        "file_id": "976bd01a-f30b-4414-86fd-50c54486e3ef"
                    }
                ],
                "validation_datasets": [],
                "hyper_parameters": {
                    "n_epochs": 3,
                    "batch_size": 32,
                    "max_length": 8192,
                    "learning_rate": "1.6e-5",
                    "lr_scheduler_type": "linear",
                    "split": 0.9
                },
                "training_type": "sft",
                "create_time": "2024-10-29 16:53:53",
                "workspace_id": "llm-v71tlv***",
                "user_identity": "1396993924585947",
                "modifier": "1396993924585947",
                "creator": "1396993924585947",
                "end_time": "2024-10-29 17:11:26",
                "group": "llm",
                "usage": 279808
            },
            {
                "job_id": "ft-202410291512-1851",
                "job_name": "ft-202410291512-1851",
                "status": "CANCELED",
                "model": "qwen3-14b",
                "base_model": "qwen3-14b",
                "training_file_ids": [],
                "validation_file_ids": [],
                "training_datasets": [
                    {
                        "data_source_type": "file_id",
                        "file_id": "86a9fe7f-dd77-43b0-9834-2170e12339ec"
                    },
                    {
                        "data_source_type": "file_id",
                        "file_id": "03ead352-6190-4328-8016-61821c23d4fc"
                    }
                ],
                "validation_datasets": [],
                "hyper_parameters": {
                    "n_epochs": 3,
                    "batch_size": 32,
                    "max_length": 8192,
                    "learning_rate": "1.6e-5",
                    "lr_scheduler_type": "linear",
                    "split": 0.9
                },
                "code": "1",
                "training_type": "sft",
                "create_time": "2024-10-29 15:12:00",
                "workspace_id": "llm-v71tlv***",
                "user_identity": "1396993924585947",
                "modifier": "1396993924585947",
                "creator": "1396993924585947",
                "end_time": "2024-10-29 15:16:00",
                "group": "llm",
                "usage": 0
            }
        ]
    }
}

Response parameters

Parameter NameTypeDescription
request_idStringThe ID of the request.
outputObjectThe details returned for the query.
output.page_noIntegerThe page number.
output.page_sizeIntegerThe number of entries displayed per page.
output.totalIntegerThe total number of fine-tuning jobs.
output.jobsArrayThe details of multiple fine-tuning jobs.

Parameter Name

Type

Description

request_id

String

The ID of the request.

output

Object

The details of the fine-tuning job.

output.job_id

String

The ID of the fine-tuning job. You can use this ID to query the job status later.

Generation rule: ft-{yyyyMMddHHmm}-{4-digit uuid}.

output.jobs_name

String

Same as output.job_id.

output.status

String

The job status of this fine-tuning job.

output.finetuned_output

String

This parameter appears only when the fine-tuning job status is SUCCEED. It returns the ID of the fine-tuned model.

output.model

String

The ID of the model used for the fine-tuning job.

output.base_model

String

The ID of the foundation model that corresponds to the model used for the fine-tuning job.

For example, the foundation model used by the fine-tuning job ft-202410291653-1c7f is qwen3-14b.

output.training_file_ids

Array

A field for compatibility. New jobs always return an empty array. Use training_datasets instead.

output.validation_file_ids

Array

A field for compatibility. New jobs always return an empty array. Use validation_datasets instead.

output.training_datasets

Array of Dataset

A list of training datasets.

output.validation_datasets

Array of Dataset

A list of test datasets.

output.hyper_parameters

Object

The explicitly declared hyperparameters.

output.training_type

String

The fine-tuning method.

output.create_time

String

The time when the fine-tuning job was created.

output.workspace_id

String

The ID of the workspace to which the fine-tuning job belongs.

output.user_identity

String

The UID of the primary account to which the fine-tuning job belongs.

output.modifier

String

The UID of the account that last operated on the fine-tuning job. (For example, if a RAM user cancels the job, the UID of the RAM user is displayed here.)

output.creator

String

The UID of the user who created the fine-tuning job.

output.end_time

String

The time when the fine-tuning job ended. This parameter appears when the job status is SUCCEED, FAILED, or CANCELED.

output.group

String

The task type of the model fine-tuning.

output.usage

Integer

The number of tokens (count) consumed by the fine-tuning job. For the billing formula, see Billing. This parameter appears when the job status is SUCCEED or CANCELED.

output.output_cnt

Integer

The number of Checkpoints that the current job has generated. This parameter is returned only for models that support multiple Checkpoint outputs (such as cosyvoice-v3-flash). You can obtain the detailed list of Checkpoints by calling the Query Checkpoint operation.

output.max_output_cnt

Integer

The maximum number of Checkpoints that a single job can generate. The part of output_cnt that exceeds this limit is truncated based on the fine-tuning sufficiency. This parameter is returned only for models that support multiple Checkpoint outputs.

Query fine-tuning job logs

Queries the training logs of a specified fine-tuning job.

Endpoint

GET https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/{job_id}/logs

Request example

curl --location --request GET "https://dashscope-intl.aliyuncs.com/api/v1/fine-tunes/<替换为您的调优任务id>/logs?offset=10&line=10" \
      --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
      --header 'Content-Type: application/json'

Request parameters

Field

Type

Parameter passing

Required

Description

job_id

String

Url Path

Yes

The ID of the fine-tuning job for which to print logs. You can obtain this ID by calling the create training job or list training jobs operation.

offset

Number

Query

No

Skips the first offset lines of output and starts reading from line offset+1. The value cannot exceed the total number of lines of existing output; otherwise, no output information is returned. The default value is 0.

line

Number

Query

No

Reads line lines of output starting from (and including) line offset+1. If the output of this request is fewer than line lines, the actual output is returned. The default value is 100, and the upper limit is 1000.

Response example

{
    "request_id": "ce49b45d-fe46-474e-9e1b-3e7427ffdf5a",
    "output": {
        "total": 20,
        "logs": [
            "{'train_runtime': 216.3999, 'train_samples_per_second': 2.066, 'train_steps_per_second': 0.014, 'train_loss': 0.9122632344563802, 'epoch': 0.8571428571428571}",
            " Actual number of consumed tokens is 279808!",
            " Uploaded checkpoint!",
            " Fine-tune succeeded!",
            " use checkpoint-3 as final checkpoint",
            "2024-10-29 17:03:47,719 - INFO - transfer for inference succeeded, start to deliver it for inference",
            "2024-10-29 17:09:43,322 - INFO - start to save checkpoint",
            "2024-10-29 17:11:24,689 - INFO - finetune-job succeeded",
            "2024-10-29 17:11:25,130 - INFO - training usage 279808",
            "2024-10-29 17:11:25,175 - INFO - ##FT_COMPLETE##"
        ]
    }
}

Response parameters

Parameter Name

Type

Description

request_id

String

The ID of the request.

output

Object

The details returned for the query.

output.total

Integer

The total number of log lines.

output.logs

Array

The output logs.

Error responses

Response example

{
    "code": "NotFound",
    "request_id": "BE213CDD-8A5C-59EE-9A67-055EAB0CB59B",
    "message": "Not Found!"
}

Response parameters

Field

Type

Description

Example value

code

String

The error code.

NotFound

request_id

String

The unique system code of the request.

6332fb02-3111-43f0-bf79-f9e8c5ffa7f9

message

String

The error message.

Not Found!

When a request fails, the following errors may be returned:

HTTP status code

Error code

Sample error message

Meaning

Solution

400

InvalidParameter

Missing training files

A parameter is invalid. For example, a parameter is missing or has an incorrect format.

Correct your parameters based on the error message.

400

UnsupportedOperation

The fine-tune job can not be canceled because it is succeeded or failed

The operation cannot be performed on the resource in its current state.

Perform the operation after the resource enters an operable state.

400

UnsupportedOperation

The fine-tune job can not be deleted because it is succeeded,failed or canceled

The operation cannot be performed on the resource in its current state.

Perform the operation after the resource enters an operable state.

404

NotFound

Not found!

The resource to query/operate does not exist.

Check whether the resource ID to query/operate is incorrect.

409

Conflict

Model instance xxxxx already exists, please specify a suffix

A deployment instance with the deployed_model name xxxxx already exists. You must specify a suffix to distinguish it.

Specify a unique suffix for the deployment.

429

Throttling

  • Too many fine-tune job in running, please retry later.

  • Only 20 fine-tune job in running or succeeded allowed per user.

The resource creation triggered a platform limit.

  • Delete models that are no longer in use.

500

InternalError

Internal server error!

An internal error occurred.

Record the request_id and contact Alibaba Cloud engineers by submitting a ticket for troubleshooting.