Returns a list of run steps belonging to a run.
GET /threads/{thread_id}/runs/{run_id}/steps
Authorizations
Parameters
Path Parameters
The ID of the thread the run and run steps belong to.
The ID of the run the run steps belong to.
Query Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Sort order by the created_at
timestamp of the objects. asc
for ascending order and desc
for descending order.
A cursor for use in pagination. after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
A cursor for use in pagination. before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content
to fetch the file search result content.
See the file search tool documentation for more information.
Responses
200
OK
object
Represents a step in execution of a run.
object
The identifier of the run step, which can be referenced in API endpoints.
The object type, which is always thread.run.step
.
The Unix timestamp (in seconds) for when the run step was created.
The ID of the assistant associated with the run step.
The ID of the thread that was run.
The ID of the run that this run step is a part of.
The type of run step, which can be either message_creation
or tool_calls
.
The status of the run step, which can be either in_progress
, cancelled
, failed
, completed
, or expired
.
Details of the message creation by the run step.
object
Always message_creation
.
object
The ID of the message that was created by this run step.
Details of the tool call.
object
Always tool_calls
.
An array of tool calls the run step was involved in. These can be associated with one of three types of tools: code_interpreter
, file_search
, or function
.
Details of the Code Interpreter tool call the run step was involved in.
object
The ID of the tool call.
The type of tool call. This is always going to be code_interpreter
for this type of tool call.
The Code Interpreter tool call definition.
object
The input to the Code Interpreter tool call.
The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (logs
) or images (image
). Each of these are represented by a different object type.
Text output from the Code Interpreter tool call as part of a run step.
object
Always logs
.
The text output from the Code Interpreter tool call.
object
Always image
.
object
The file ID of the image.
object
The ID of the tool call object.
The type of tool call. This is always going to be file_search
for this type of tool call.
For now, this is always going to be an empty object.
object
The ranking options for the file search.
object
The ranker used for the file search.
The score threshold for the file search. All values must be a floating point number between 0 and 1.
The results of the file search.
A result instance of the file search.
object
The ID of the file that result was found in.
The name of the file that result was found in.
The score of the result. All values must be a floating point number between 0 and 1.
The content of the result that was found. The content is only included if requested via the include query parameter.
object
The type of the content.
The text content of the file.
object
The ID of the tool call object.
The type of tool call. This is always going to be function
for this type of tool call.
The definition of the function that was called.
object
The name of the function.
The arguments passed to the function.
The output of the function. This will be null
if the outputs have not been submitted yet.
The last error associated with this run step. Will be null
if there are no errors.
object
One of server_error
or rate_limit_exceeded
.
A human-readable description of the error.
The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
The Unix timestamp (in seconds) for when the run step was cancelled.
The Unix timestamp (in seconds) for when the run step failed.
The Unix timestamp (in seconds) for when the run step completed.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
object
Usage statistics related to the run step. This value will be null
while the run step’s status is in_progress
.
object
Number of completion tokens used over the course of the run step.
Number of prompt tokens used over the course of the run step.
Total number of tokens used (prompt + completion).