Create an assistant
POST/ai/assistants
Create a new AI Assistant.
Request
- application/json
Body
required
Array [
]
name Name (string)required
model Model (string)required
description Description (string)
instructions Instructions (string)required
tools
object[]
The function
tool type follows the same schema as the OpenAI Assistants API. The retrieval
tool type is unique to Telnyx. You may pass a list of embedded storage buckets for retrieval-augmented generation.
oneOf
Responses
200: Successful Response
- application/json
422: Validation Error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/ai/assistants' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "string",
"model": "string",
"description": "string",
"instructions": "string",
"tools": [
{
"type": "function",
"function": {
"name": "string",
"description": "string",
"parameters": {}
}
},
{
"type": "retrieval",
"retrieval": {
"bucket_ids": [
"string"
],
"max_num_results": 0
}
}
]
}'
Response samples
{
"id": "string",
"name": "string",
"created_at": "2024-07-29T15:51:28.071Z",
"description": "string",
"model": "string",
"instructions": "string",
"tools": [
{},
{}
]
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}