Пропустить и перейти к основному содержимому

Этот браузер больше не поддерживается.

Выполните обновление до Microsoft Edge, чтобы воспользоваться новейшими функциями, обновлениями для системы безопасности и технической поддержкой.

Скачать Microsoft Edge Дополнительные сведения об Internet Explorer и Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Threads, Assistants

List run steps

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

Lists run steps matching the request filters.

Параметры пути

thread_id string обязательно

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

run_id string обязательно

The ID of the run the run steps belong to.

Параметры запроса

limit integer

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

order enum

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

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

include[] enum[]

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.

Ответы

The request has succeeded.

Текст

Content-Type: application/json
object string обязательно
data OpenAI.RunStepObject[] обязательно
first_id string обязательно
last_id string обязательно
has_more boolean обязательно

Client error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Текст

Content-Type: application/json
error OpenAI.Error обязательно
code string | null обязательно
message string обязательно
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Любое из следующих:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string обязательно

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Запрос

curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "OpenAI-Beta: assistants=v2"
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
page = client.beta.threads.runs.steps.list(
    run_id="run_id",
    thread_id="thread_id",
)
page = page.data[0]
print(page.id)
import OpenAI from "openai";
const openai = new OpenAI();

async function main() {
  const runStep = await openai.beta.threads.runs.steps.list(
    "run_abc123",
    { thread_id: "thread_abc123" }
  );
  console.log(runStep);
}

main();
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const runStep of client.beta.threads.runs.steps.list('run_id', {
  thread_id: 'thread_id',
})) {
  console.log(runStep.id);
}
package main

import (
    "context"
    "fmt"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    page, err := client.Beta.Threads.Runs.Steps.List(
        context.TODO(),
        "thread_id",
        "run_id",
        openai.BetaThreadRunStepListParams{},
    )
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", page)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.threads.runs.steps.StepListPage;
import com.openai.models.beta.threads.runs.steps.StepListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        StepListParams params = StepListParams.builder()
            .threadId("thread_id")
            .runId("run_id")
            .build();
        StepListPage page = client.beta().threads().runs().steps().list(params);
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

page = openai.beta.threads.runs.steps.list("run_id", thread_id: "thread_id")

puts(page)

Response

{
  "object": "list",
  "data": [
    {
      "id": "step_abc123",
      "object": "thread.run.step",
      "created_at": 1699063291,
      "run_id": "run_abc123",
      "assistant_id": "asst_abc123",
      "thread_id": "thread_abc123",
      "type": "message_creation",
      "status": "completed",
      "cancelled_at": null,
      "completed_at": 1699063291,
      "expired_at": null,
      "failed_at": null,
      "last_error": null,
      "step_details": {
        "type": "message_creation",
        "message_creation": {
          "message_id": "msg_abc123"
        }
      },
      "usage": {
        "prompt_tokens": 123,
        "completion_tokens": 456,
        "total_tokens": 579
      }
    }
  ],
  "first_id": "step_abc123",
  "last_id": "step_abc456",
  "has_more": false
}
ru-ru
Ваши варианты выбора параметров конфиденциальности
  • Заявление об отказе ИИ
  • Предыдущие версии
  • Блог
  • Участие в доработке
  • Конфиденциальность
  • Конфиденциальность медицинских данных потребителей
  • Условия использования
  • Товарные знаки
  • © Microsoft 2026