Path parameters
-
The ID of the thread the run belongs to.
Query parameters
-
limit integer
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Default value is
20
. -
order string
Sort order by the
created_at
timestamp of the objects.asc
for ascending order anddesc
for descending order.Values are
asc
ordesc
. Default value isdesc
. -
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, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
curl \
-X GET https://api.openai.com/v1/threads/{thread_id}/runs \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"object": "list",
"data": [
{
"id": "string",
"object": "thread.run",
"created_at": 42,
"thread_id": "string",
"assistant_id": "string",
"status": "queued",
"required_action": {
"type": "submit_tool_outputs",
"submit_tool_outputs": {
"tool_calls": [
{
"id": "string",
"type": "function",
"function": {
"name": "string",
"arguments": "string"
}
}
]
}
},
"last_error": {
"code": "server_error",
"message": "string"
},
"expires_at": 42,
"started_at": 42,
"cancelled_at": 42,
"failed_at": 42,
"completed_at": 42,
"incomplete_details": {
"reason": "max_completion_tokens"
},
"model": "string",
"instructions": "string",
"tools": [
{
"type": "code_interpreter"
}
],
"metadata": {},
"usage": {
"completion_tokens": 42,
"prompt_tokens": 42,
"total_tokens": 42
},
"temperature": 42.0,
"top_p": 42.0,
"max_prompt_tokens": 42,
"max_completion_tokens": 42,
"truncation_strategy": {
"type": "auto",
"last_messages": 42
},
"tool_choice": "none",
"response_format": "none"
}
],
"first_id": "run_abc123",
"last_id": "run_abc456",
"has_more": false
}