Create run (v1)
POST
https://api.openai.com/v1/threads/thread_abc123/runs
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai.com/v1/threads/thread_abc123/runs' \
--header 'Authorization: Bearer $OPENAI_API_KEY' \
--header 'OpenAI-Beta: assistants=v1' \
--header 'Content-Type: application/json' \
--data-raw '{
"assistant_id": "asst_abc123"
}'
Response Response 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"
}
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
Responses
Modified atΒ 2024-12-12 08:54:36