Run steps describe the actions that an agent takes during a run, including model and tool calls.
List run steps
Returns a list of all steps for a run task.
Sample request
- HTTP
- SDK
Request body
Parameter Name | Type | Required | Default | Description |
|---|---|---|---|---|
run_id | string | Yes | The ID of the Run for which you want to list the steps. | |
thread_id | string | Yes | The ID of the Thread. | |
limit | integer | No | None | The number of running steps to retrieve. The default is None. A value of None uses the server-side default value. |
order | string | No | None | The order in which to sort the results based on the created_at field. You can set this parameter to asc (ascending) or desc (descending). The default value is None, which indicates that the server-side default sorting method is used. |
after | string | No | None | ID of the run step to use as a cursor for pagination. When provided, returns the page of results immediately after this step. |
before | string | No | None | ID of the run step to use as a cursor for pagination. When provided, returns the page of results immediately before this step. |
workspace | string | Yes | None | The Workspace ID for Alibaba Cloud Model Studio is required only if the `api_key` is an API key for a sub-workspace. |
api_key | string | Yes | None | The API Key of Model Studio. We recommend that you configure the API Key as an environment variable. |
Sample response
Response body
A list of run step objects
Retrieve a run step
Sample request
- HTTP
- SDK
Request body
Parameter name | Type | Required | Default | Description |
|---|---|---|---|---|
step_id | string | Yes | The ID of the RunStep to retrieve. | |
thread_id | string | Yes | The ID of the Thread. | |
run_id | string | Yes | The ID of the Run. | |
workspace | string | Yes | None | The Workspace ID for Alibaba Cloud Model Studio is required only if you are using a sub-workspace API Key. |
api_key | string | Yes | None | The API Key of Model Studio. We recommend that you configure the API Key as an environment variable. |
Sample response
Response body
The run step object that matches the specified ID.
Run step object
Represents a step in the execution process of a run.
Object example
Object attributes
Parameter Name | Type | Description |
|---|---|---|
id | string | The unique identifier of the run step, which can be referenced in API endpoints. |
assistant_id | string | The ID of the assistant associated with this run step. |
cancelled_at | integer | The 13-digit UNIX timestamp (in milliseconds) when the run step was canceled. |
completed_at | integer | The 13-digit UNIX timestamp (in milliseconds) when the run step was completed. |
created_at | integer | The 13-digit UNIX timestamp (in milliseconds) when the run step was created. |
expired_at | integer | The 13-digit UNIX timestamp (in milliseconds) when the run step expired. If the parent run has expired, the step is also considered expired. |
failed_at | integer | The 13-digit UNIX timestamp (in milliseconds) when the run step failed. |
last_error | object | The last error associated with this run step. This parameter is null if no error occurred. |
metadata | map | A set of up to 16 key-value pairs that can be attached to the object. This is used to store additional information about the object in a structured format. The maximum length of a key is 64 characters and the maximum length of a value is 512 characters. |
object | string | The object type, which is always thread.run.step. |
run_id | string | The ID of the run to which this run step belongs. |
status | string | The status of the run step. Valid values: in_progress, cancelled, failed, completed, or expired. |
step_details | object | The details of the run step. |
thread_id | string | The ID of the running thread. |
type | string | The type of the run step. Valid values: message_creation or tool_calls. |
usage | object | Resource usage statistics. |
status_code | integer | The HTTP status code. Note: This parameter is used for internal processing. In most cases, you do not need to concern yourself with this parameter. |