---
title: "Retrieves a run step."
method: GET
path: "/threads/{thread_id}/runs/{run_id}/steps/{step_id}"
tags: ["Assistants"]
---

# Retrieves a run step.

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

## Path parameters

- `thread_id` string, required
- `run_id` string, required
- `step_id` string, required

## Query parameters

- `include[]` string[]

## Response `200`

OK

- RunStepObject — Represents a step in execution of a run.
  - `id` string, required — The identifier of the run step, which can be referenced in API endpoints.
  - `object` 'thread.run.step', required — The object type, which is always `thread.run.step`.
  - `created_at` integer, required — The Unix timestamp (in seconds) for when the run step was created.
  - `assistant_id` string, required — The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.
  - `thread_id` string, required — The ID of the [thread](/docs/api-reference/threads) that was run.
  - `run_id` string, required — The ID of the [run](/docs/api-reference/runs) that this run step is a part of.
  - `type` 'message_creation' | 'tool_calls', required — The type of run step, which can be either `message_creation` or `tool_calls`.
  - `status` 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired', required — The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
  - `step_details` union, required — The details of the run step.
    - object — Details of the message creation by the run step.
      - `type` 'message_creation', required — Always `message_creation`.
      - `message_creation` object, required
        - `message_id` string, required — The ID of the message that was created by this run step.
    - object — Details of the tool call.
      - `type` 'tool_calls', required — Always `tool_calls`.
      - `tool_calls` union[], required — 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`.
        - union
          - object — Details of the Code Interpreter tool call the run step was involved in.
            - `id` string, required — The ID of the tool call.
            - `type` 'code_interpreter', required — The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
            - `code_interpreter` object, required — The Code Interpreter tool call definition.
              - …
          - object
            - `id` string, required — The ID of the tool call object.
            - `type` 'file_search', required — The type of tool call. This is always going to be `file_search` for this type of tool call.
            - `file_search` object, required — For now, this is always going to be an empty object.
              - …
          - object
            - `id` string, required — The ID of the tool call object.
            - `type` 'function', required — The type of tool call. This is always going to be `function` for this type of tool call.
            - `function` object, required — The definition of the function that was called.
              - …
  - `last_error` object, nullable, required — The last error associated with this run step. Will be `null` if there are no errors.
    - `code` 'server_error' | 'rate_limit_exceeded', required — One of `server_error` or `rate_limit_exceeded`.
    - `message` string, required — A human-readable description of the error.
  - `expired_at` integer, nullable, required — The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
  - `cancelled_at` integer, nullable, required — The Unix timestamp (in seconds) for when the run step was cancelled.
  - `failed_at` integer, nullable, required — The Unix timestamp (in seconds) for when the run step failed.
  - `completed_at` integer, nullable, required — The Unix timestamp (in seconds) for when the run step completed.
  - `metadata` object, nullable, 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 maximum of 512 characters long.
  - `usage` RunStepCompletionUsage, nullable, required — Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
    - `completion_tokens` integer, required — Number of completion tokens used over the course of the run step.
    - `prompt_tokens` integer, required — Number of prompt tokens used over the course of the run step.
    - `total_tokens` integer, required — Total number of tokens used (prompt + completion).

---

[API](https://skmtc.net/omnistack-sh/apis/openai-api.md) · [All operations](https://skmtc.net/omnistack-sh/apis/openai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omnistack-sh/openai-api/versions/a127ad1d97cb/schema)
