Skip to content

Returns a list of run steps belonging to a run.

GET
/threads/{thread_id}/runs/{run_id}/steps

Authorizations

Parameters

Path Parameters

thread_id
required
string

The ID of the thread the run and run steps belong to.

run_id
required
string

The ID of the run the run steps belong to.

Query Parameters

limit
integer
default: 20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

order
string
default: desc
Allowed values: asc desc

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

after
string

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.

before
string

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.

Responses

200

OK

object
object
required
string
list
data
required
Array<object>

Represents a step in execution of a run.

object
id
required

The identifier of the run step, which can be referenced in API endpoints.

string
object
required

The object type, which is always thread.run.step.

string
Allowed values: thread.run.step
created_at
required

The Unix timestamp (in seconds) for when the run step was created.

integer
assistant_id
required

The ID of the assistant associated with the run step.

string
thread_id
required

The ID of the thread that was run.

string
run_id
required

The ID of the run that this run step is a part of.

string
type
required

The type of run step, which can be either message_creation or tool_calls.

string
Allowed values: message_creation tool_calls
status
required

The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.

string
Allowed values: in_progress cancelled failed completed expired
step_details
required
One of:

Details of the message creation by the run step.

object
type
required

Always message_creation.

string
Allowed values: message_creation
message_creation
required
object
message_id
required

The ID of the message that was created by this run step.

string
last_error
required

The last error associated with this run step. Will be null if there are no errors.

object
code
required

One of server_error or rate_limit_exceeded.

string
Allowed values: server_error rate_limit_exceeded
message
required

A human-readable description of the error.

string
expired_at
required

The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.

integer
nullable
cancelled_at
required

The Unix timestamp (in seconds) for when the run step was cancelled.

integer
nullable
failed_at
required

The Unix timestamp (in seconds) for when the run step failed.

integer
nullable
completed_at
required

The Unix timestamp (in seconds) for when the run step completed.

integer
nullable
metadata
required

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 maxium of 512 characters long.

object
usage
required

Usage statistics related to the run step. This value will be null while the run step’s status is in_progress.

object
completion_tokens
required

Number of completion tokens used over the course of the run step.

integer
prompt_tokens
required

Number of prompt tokens used over the course of the run step.

integer
total_tokens
required

Total number of tokens used (prompt + completion).

integer
first_id
required
string
step_abc123
last_id
required
string
step_abc456
has_more
required
boolean