Create run (v1)
POST
https://api.openai.com/v1/threads/thread_abc123/runsCreate a run.
Request
Header Params
Authorization
string
required
Example:
Bearer $OPENAI_API_KEY
Content-Type
string
required
Example:
application/json
OpenAI-Beta
string
required
Example:
assistants=v1
Body Params application/json
assistant_id
string
required
The ID of the assistant to use to execute this run.
Example
{
"assistant_id": "asst_abc123"
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
id
string
required
object
string
required
created_at
integer
required
assistant_id
string
required
thread_id
string
required
status
string
required
started_at
integer
required
expires_at
null
required
cancelled_at
null
required
failed_at
null
required
completed_at
integer
required
last_error
null
required
model
string
required
instructions
null
required
incomplete_details
null
required
tools
array [object {1}]
required
type
string
optional
file_ids
array[string]
required
metadata
object
required
usage
null
required
temperature
integer
required
top_p
integer
required
max_prompt_tokens
integer
required
max_completion_tokens
integer
required
truncation_strategy
object
required
type
string
required
last_messages
null
required
response_format
string
required
tool_choice
string
required
Example
{
"id": "run_abc123",
"object": "thread.run",
"created_at": 1699063290,
"assistant_id": "asst_abc123",
"thread_id": "thread_abc123",
"status": "queued",
"started_at": 1699063290,
"expires_at": null,
"cancelled_at": null,
"failed_at": null,
"completed_at": 1699063291,
"last_error": null,
"model": "gpt-4-turbo",
"instructions": null,
"incomplete_details": null,
"tools": [
{
"type": "code_interpreter"
}
],
"file_ids": [
"file-abc123",
"file-abc456"
],
"metadata": {},
"usage": null,
"temperature": 1,
"top_p": 1,
"max_prompt_tokens": 1000,
"max_completion_tokens": 1000,
"truncation_strategy": {
"type": "auto",
"last_messages": null
},
"response_format": "auto",
"tool_choice": "auto"
}
Last modified: 14 days ago