curl --request GET \
--url https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "thread.run.step",
"created_at": 123,
"assistant_id": "<string>",
"thread_id": "<string>",
"run_id": "<string>",
"type": "message_creation",
"status": "in_progress",
"step_details": {
"type": "message_creation",
"message_creation": {
"message_id": "<string>"
}
},
"last_error": {
"code": "server_error",
"message": "<string>"
},
"expired_at": 123,
"cancelled_at": 123,
"failed_at": 123,
"completed_at": 123,
"metadata": {},
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}Retrieves a run step.
curl --request GET \
--url https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "thread.run.step",
"created_at": 123,
"assistant_id": "<string>",
"thread_id": "<string>",
"run_id": "<string>",
"type": "message_creation",
"status": "in_progress",
"step_details": {
"type": "message_creation",
"message_creation": {
"message_id": "<string>"
}
},
"last_error": {
"code": "server_error",
"message": "<string>"
},
"expired_at": 123,
"cancelled_at": 123,
"failed_at": 123,
"completed_at": 123,
"metadata": {},
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the thread to which the run and run step belongs.
The ID of the run to which the run step belongs.
The ID of the run step to retrieve.
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.
step_details.tool_calls[*].file_search.results[*].content OK
Represents a step in execution of a run.
The identifier of the run step, which can be referenced in API endpoints.
The object type, which is always thread.run.step.
thread.run.step The Unix timestamp (in seconds) for when the run step was created.
The type of run step, which can be either message_creation or tool_calls.
message_creation, tool_calls The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.
in_progress, cancelled, failed, completed, expired Details of the message creation by the run step.
Show child attributes
The last error associated with this run step. Will be null if there are no errors.
Show child attributes
The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
The Unix timestamp (in seconds) for when the run step was cancelled.
The Unix timestamp (in seconds) for when the run step failed.
The Unix timestamp (in seconds) for when the run step completed.
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.
Show child attributes
Usage statistics related to the run step. This value will be null while the run step's status is in_progress.
Show child attributes
Was this page helpful?