NAME

OpenAPI::Client::OpenAI::Path::threads-thread_id-runs-run_id-steps - Documentation for the /threads/{thread_id}/runs/{run_id}/steps path.

OPERATIONS

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

listRunSteps

$client->list_run_steps({
    body => { ... },
});

Returns a list of run steps belonging to a run.

Path/query parameters

  • thread_id (in path, required, string) - The ID of the thread the run and run steps belong to.

  • run_id (in path, required, string) - The ID of the run the run steps belong to.

  • limit (in query, optional, integer) - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

    Default: 20

  • order (in query, optional, string) - Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

    Allowed values: asc, desc

    Default: desc

  • after (in query, optional, 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 (in query, optional, 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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

  • include[] (in query, optional, array) - 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

Content-Type: application/json

Example:

{
   "data" : [
      "{\n  \"id\": \"step_abc123\",\n  \"object\": \"thread.run.step\",\n  \"created_at\": 1699063291,\n  \"run_id\": \"run_abc123\",\n  \"assistant_id\": \"asst_abc123\",\n  \"thread_id\": \"thread_abc123\",\n  \"type\": \"message_creation\",\n  \"status\": \"completed\",\n  \"cancelled_at\": null,\n  \"completed_at\": 1699063291,\n  \"expired_at\": null,\n  \"failed_at\": null,\n  \"last_error\": null,\n  \"step_details\": {\n    \"type\": \"message_creation\",\n    \"message_creation\": {\n      \"message_id\": \"msg_abc123\"\n    }\n  },\n  \"usage\": {\n    \"prompt_tokens\": 123,\n    \"completion_tokens\": 456,\n    \"total_tokens\": 579\n  }\n}\n"
   ],
   "first_id" : "step_abc123",
   "has_more" : false,
   "last_id" : "step_abc456",
   "object" : "list"
}

SCHEMAS

ListRunStepsResponse

Properties:

  • data (array of RunStepObject, required)

  • first_id (string, required)

  • has_more (boolean, required)

  • last_id (string, required)

  • object (string, required)

Metadata

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, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

RunStepCompletionUsage

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

RunStepObject

Properties:

  • assistant_id (string, required) - The ID of the assistant associated with the run step.

  • cancelled_at (anyOf, required)

  • completed_at (anyOf, required)

  • created_at (integer, required) - The Unix timestamp (in seconds) for when the run step was created.

  • expired_at (anyOf, required)

  • failed_at (anyOf, required)

  • id (string, required) - The identifier of the run step, which can be referenced in API endpoints.

  • last_error (anyOf, required)

  • metadata (Metadata, required)

    See "Metadata" below for shape.

  • object (string, required) - The object type, which is always thread.run.step .

    Allowed values: thread.run.step

  • run_id (string, required) - The ID of the run that this run step is a part of.

  • status (string, required) - The status of the run step, which can be either in_progress , cancelled , failed , completed , or expired .

    Allowed values: in_progress, cancelled, failed, completed, expired

  • step_details (object, required) - The details of the run step.

  • thread_id (string, required) - The ID of the thread that was run.

  • type (string, required) - The type of run step, which can be either message_creation or tool_calls .

    Allowed values: message_creation, tool_calls

  • usage (RunStepCompletionUsage, required)

    See "RunStepCompletionUsage" below for shape.

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.