Създаване на инструмент за време на повикване
curl --request POST \
--url https://call.aiployees.com/api/user/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"method": "<string>",
"timeout": 123,
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"schema": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://call.aiployees.com/api/user/tools"
payload = {
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"method": "<string>",
"timeout": 123,
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"schema": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
endpoint: '<string>',
method: '<string>',
timeout: 123,
headers: [{name: '<string>', value: '<string>'}],
schema: [{name: '<string>', type: '<string>', description: '<string>'}]
})
};
fetch('https://call.aiployees.com/api/user/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://call.aiployees.com/api/user/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'endpoint' => '<string>',
'method' => '<string>',
'timeout' => 123,
'headers' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'schema' => [
[
'name' => '<string>',
'type' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://call.aiployees.com/api/user/tools"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://call.aiployees.com/api/user/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Tool created successfully",
"data": {
"id": 1,
"name": "check_order_status",
"description": "Use this tool to check the status of a customer's order.",
"endpoint": "https://api.yourstore.com/orders/status",
"method": "GET",
"timeout": 10,
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer sk_..."
}
],
"schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer's order ID"
},
{
"name": "order_number",
"type": "number",
"description": "The numeric order number"
},
{
"name": "priority_order",
"type": "boolean",
"description": "Whether this is a priority order"
}
],
"created_at": "2025-10-10T12:00:00.000000Z",
"updated_at": "2025-10-10T12:00:00.000000Z"
}
}
{
"message": "The name field must contain only lowercase letters and underscores, and start with a letter.",
"errors": {
"name": [
"Tool name must contain only lowercase letters and underscores, and start with a letter."
]
}
}
{
"message": "You have reached your plan limit of 5 mid call tools. Please upgrade your plan to create more tools."
}
Инструменти по време на обаждане
Създаване на инструмент за време на повикване
Създаване на нов инструмент за време на повикване
POST
/
user
/
tools
Създаване на инструмент за време на повикване
curl --request POST \
--url https://call.aiployees.com/api/user/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"method": "<string>",
"timeout": 123,
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"schema": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://call.aiployees.com/api/user/tools"
payload = {
"name": "<string>",
"description": "<string>",
"endpoint": "<string>",
"method": "<string>",
"timeout": 123,
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"schema": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
endpoint: '<string>',
method: '<string>',
timeout: 123,
headers: [{name: '<string>', value: '<string>'}],
schema: [{name: '<string>', type: '<string>', description: '<string>'}]
})
};
fetch('https://call.aiployees.com/api/user/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://call.aiployees.com/api/user/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'endpoint' => '<string>',
'method' => '<string>',
'timeout' => 123,
'headers' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'schema' => [
[
'name' => '<string>',
'type' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://call.aiployees.com/api/user/tools"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://call.aiployees.com/api/user/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"method\": \"<string>\",\n \"timeout\": 123,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"schema\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Tool created successfully",
"data": {
"id": 1,
"name": "check_order_status",
"description": "Use this tool to check the status of a customer's order.",
"endpoint": "https://api.yourstore.com/orders/status",
"method": "GET",
"timeout": 10,
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer sk_..."
}
],
"schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer's order ID"
},
{
"name": "order_number",
"type": "number",
"description": "The numeric order number"
},
{
"name": "priority_order",
"type": "boolean",
"description": "Whether this is a priority order"
}
],
"created_at": "2025-10-10T12:00:00.000000Z",
"updated_at": "2025-10-10T12:00:00.000000Z"
}
}
{
"message": "The name field must contain only lowercase letters and underscores, and start with a letter.",
"errors": {
"name": [
"Tool name must contain only lowercase letters and underscores, and start with a letter."
]
}
}
{
"message": "You have reached your plan limit of 5 mid call tools. Please upgrade your plan to create more tools."
}
Този endpoint ви позволява да създадете нов инструмент за време на повикване, който може да бъде използван от вашите AI асистенти за взаимодействие с външни API по време на повиквания.
Параметри в тялото на заявката
string
required
Име на инструмента - трябва да съдържа само малки букви и долни черти, и да започва с буква (например,
get_weather, book_appointment)string
required
Подробно обяснение кога и как AI трябва да използва този инструмент (максимум 255 символа)
string
required
Валиден URL на API endpoint за извикване
string
required
HTTP метод:
GET, POST, PUT, PATCH, или DELETEinteger
Timeout на заявката в секунди (1-30, по подразбиране: 10)
array
array
Параметри, които AI ще извлече от разговора и ще изпрати до endpoint
Полета в отговора
string
Съобщение за успех
object
Обектът на създадения инструмент
{
"message": "Tool created successfully",
"data": {
"id": 1,
"name": "check_order_status",
"description": "Use this tool to check the status of a customer's order.",
"endpoint": "https://api.yourstore.com/orders/status",
"method": "GET",
"timeout": 10,
"headers": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer sk_..."
}
],
"schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer's order ID"
},
{
"name": "order_number",
"type": "number",
"description": "The numeric order number"
},
{
"name": "priority_order",
"type": "boolean",
"description": "Whether this is a priority order"
}
],
"created_at": "2025-10-10T12:00:00.000000Z",
"updated_at": "2025-10-10T12:00:00.000000Z"
}
}
{
"message": "The name field must contain only lowercase letters and underscores, and start with a letter.",
"errors": {
"name": [
"Tool name must contain only lowercase letters and underscores, and start with a letter."
]
}
}
{
"message": "You have reached your plan limit of 5 mid call tools. Please upgrade your plan to create more tools."
}
Прикачване на инструменти към асистенти
След създаването на инструмент, трябва да го прикачите към асистент за да го използвате по време на повиквания. Инструментите се управляват чрез Assistant API:- Създаване на асистент - Използвайте параметъра
tool_idsза да прикачите инструменти при създаване на асистент - Актуализиране на асистент - Използвайте параметъра
tool_idsза да добавите, премахнете или заместите инструменти на съществуващ асистент
⌘I

