Retrieve run

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

Retrieves a run.

Path parameters

  • thread_id
    string
    Required

    The ID of the thread that was run.

  • run_id
    string
    Required
    The ID of the run to retrieve.

Response

The run object matching the specified ID.

Example request
1
curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
2
-H "Authorization: Bearer $OPENAI_API_KEY" \
3
-H "OpenAI-Beta: assistants=v2"
Example response
1
{
2
"id": "run_abc123",
3
"object": "thread.run",
4
"created_at": 1699075072,
5
"assistant_id": "asst_abc123",
6
"thread_id": "thread_abc123",
7
"status": "completed",
8
"started_at": 1699075072,
9
"expires_at": null,
10
"cancelled_at": null,
11
"failed_at": null,
12
"completed_at": 1699075073,
13
"last_error": null,
14
"model": "gpt-4o",
15
"instructions": null,
16
"incomplete_details": null,
17
"tools": [
18
{
19
"type": "code_interpreter"
20
}
21
],
22
"metadata": {},
23
"usage": {
24
"prompt_tokens": 123,
25
"completion_tokens": 456,
26
"total_tokens": 579
27
},
28
"temperature": 1.0,
29
"top_p": 1.0,
30
"max_prompt_tokens": 1000,
31
"max_completion_tokens": 1000,
32
"truncation_strategy": {
33
"type": "auto",
34
"last_messages": null
35
},
36
"response_format": "auto",
37
"tool_choice": "auto",
38
"parallel_tool_calls": true
39
}
Built with