NAME

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

OPERATIONS

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

getRunStep

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

Retrieves a run step.

Path/query parameters

  • thread_id (in path, required, string) - The ID of the thread to which the run and run step belongs.

  • run_id (in path, required, string) - The ID of the run to which the run step belongs.

  • step_id (in path, required, string) - The ID of the run step to retrieve.

  • 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:

{
   "assistant_id" : "asst_abc123",
   "cancelled_at" : null,
   "completed_at" : 1699063291,
   "created_at" : 1699063291,
   "expired_at" : null,
   "failed_at" : null,
   "id" : "step_abc123",
   "last_error" : null,
   "object" : "thread.run.step",
   "run_id" : "run_abc123",
   "status" : "completed",
   "step_details" : {
      "message_creation" : {
         "message_id" : "msg_abc123"
      },
      "type" : "message_creation"
   },
   "thread_id" : "thread_abc123",
   "type" : "message_creation",
   "usage" : {
      "completion_tokens" : 456,
      "prompt_tokens" : 123,
      "total_tokens" : 579
   }
}

SCHEMAS

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.