Retrieves a run step.
GET /threads/{thread_id}/runs/{run_id}/steps/{step_id}
Authorizations
Parameters
Path Parameters
The ID of the thread to which the run and run step belongs.
The ID of the run to which the run step belongs.
The ID of the run step to retrieve.
Query Parameters
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
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).