Create assistant (v1)
POST
https://api.openai.com/v1/assistantsCreate an assistant with a model and instructions.
Request
Header Params
Content-Type
string
required
Example:
application/json
Authorization
string
required
Example:
Bearer $OPENAI_API_KEY
OpenAI-Beta
string
required
Example:
assistants=v1
Body Params application/json
instructions
string
required
The system instructions that the assistant uses. The maximum length is 256,000 characters.
name
string
required
The name of the assistant. The maximum length is 256 characters.
tools
array [object {1}]
required
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter
, retrieval
, or function
.
type
string
optional
model
string
required
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. type: string
Example
{
"instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
"name": "Math Tutor",
"tools": [
{
"type": "code_interpreter"
}
],
"model": "gpt-4-turbo"
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
id
string
required
object
string
required
created_at
integer
required
name
string
required
description
null
required
model
string
required
instructions
string
required
tools
array [object {1}]
required
type
string
optional
file_ids
array[string]
required
metadata
object
required
top_p
integer
required
temperature
integer
required
response_format
string
required
Example
{
"id": "asst_abc123",
"object": "assistant",
"created_at": 1698984975,
"name": "Math Tutor",
"description": null,
"model": "gpt-4-turbo",
"instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
"tools": [
{
"type": "code_interpreter"
}
],
"file_ids": [],
"metadata": {},
"top_p": 1,
"temperature": 1,
"response_format": "auto"
}
Last modified: 14 days ago