亮色模式
Create thread and run (v1)
POST
https://api.openai.com/v1/threads/runsCreate a thread and run it in one request.
Request
Header 参数
Authorization
string
必需
示例值:
Bearer $OPENAI_API_KEY
Content-Type
string
必需
示例值:
application/json
OpenAI-Beta
string
必需
示例值:
assistants=v1
示例
{
"assistant_id": "asst_abc123",
"thread": {
"messages": [
{
"role": "user",
"content": "Explain deep learning to a 5 year old."
}
]
}
}
Request samples
返回响应
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
数据结构
id
string
必需
object
string
必需
created_at
integer
必需
assistant_id
string
必需
thread_id
string
必需
status
string
必需
started_at
null
必需
expires_at
integer
必需
cancelled_at
null
必需
failed_at
null
必需
completed_at
null
必需
last_error
null
必需
model
string
必需
instructions
string
必需
tools
array[string]
必需
file_ids
array[string]
必需
metadata
object
必需
usage
null
必需
temperature
integer
必需
示例
{
"id": "run_abc123",
"object": "thread.run",
"created_at": 1699076792,
"assistant_id": "asst_abc123",
"thread_id": "thread_abc123",
"status": "queued",
"started_at": null,
"expires_at": 1699077392,
"cancelled_at": null,
"failed_at": null,
"completed_at": null,
"last_error": null,
"model": "gpt-4-turbo",
"instructions": "You are a helpful assistant.",
"tools": [],
"file_ids": [],
"metadata": {},
"usage": null,
"temperature": 1
}
最后修改时间: 10 天前