Retrieve run step

GEThttps:/api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}

Retrieves a run step.

Path parameters

  • thread_id
    string
    Required
    The ID of the thread to which the run and run step belongs.
  • run_id
    string
    Required
    The ID of the run to which the run step belongs.
  • step_id
    string
    Required
    The ID of the run step to retrieve.

Query parameters

  • include[]
    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.

Response

The run step object matching the specified ID.

Example request
1
curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \
2
-H "Authorization: Bearer $OPENAI_API_KEY" \
3
-H "Content-Type: application/json" \
4
-H "OpenAI-Beta: assistants=v2"
Example response
1
{
2
"id": "step_abc123",
3
"object": "thread.run.step",
4
"created_at": 1699063291,
5
"run_id": "run_abc123",
6
"assistant_id": "asst_abc123",
7
"thread_id": "thread_abc123",
8
"type": "message_creation",
9
"status": "completed",
10
"cancelled_at": null,
11
"completed_at": 1699063291,
12
"expired_at": null,
13
"failed_at": null,
14
"last_error": null,
15
"step_details": {
16
"type": "message_creation",
17
"message_creation": {
18
"message_id": "msg_abc123"
19
}
20
},
21
"usage": {
22
"prompt_tokens": 123,
23
"completion_tokens": 456,
24
"total_tokens": 579
25
}
26
}
Built with