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