Create Agent
curl --request POST \
--url https://api.example.com/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"execution_mode": "balanced",
"models": {},
"knowledge_bases": [
"<string>"
],
"skills": [
"<string>"
],
"tool_categories": [
"<string>"
],
"suggested_prompts": [
"<string>"
],
"generate_runtime_key": true
}
'import requests
url = "https://api.example.com/v1/agents"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"execution_mode": "balanced",
"models": {},
"knowledge_bases": ["<string>"],
"skills": ["<string>"],
"tool_categories": ["<string>"],
"suggested_prompts": ["<string>"],
"generate_runtime_key": True
}
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>',
instructions: '<string>',
execution_mode: 'balanced',
models: {},
knowledge_bases: ['<string>'],
skills: ['<string>'],
tool_categories: ['<string>'],
suggested_prompts: ['<string>'],
generate_runtime_key: true
})
};
fetch('https://api.example.com/v1/agents', 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://api.example.com/v1/agents",
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>',
'instructions' => '<string>',
'execution_mode' => 'balanced',
'models' => [
],
'knowledge_bases' => [
'<string>'
],
'skills' => [
'<string>'
],
'tool_categories' => [
'<string>'
],
'suggested_prompts' => [
'<string>'
],
'generate_runtime_key' => true
]),
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://api.example.com/v1/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\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://api.example.com/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/agents")
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 \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": 123,
"user_id": 123,
"name": "<string>",
"execution_mode": "<string>",
"knowledge_bases": [
"<string>"
],
"skills": [
"<string>"
],
"tool_categories": [
"<string>"
],
"suggested_prompts": [
"<string>"
],
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"widget_enabled": true,
"allowed_domains": [
"<string>"
],
"share_enabled": true,
"share_updated_at": "<string>",
"description": "<string>",
"instructions": "<string>",
"models": {},
"logo_url": "<string>",
"published_at": "<string>"
},
"api_key": {
"full_key": "<string>",
"key_prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}SDK v1
Create Agent
POST
/
v1
/
agents
Create Agent
curl --request POST \
--url https://api.example.com/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"execution_mode": "balanced",
"models": {},
"knowledge_bases": [
"<string>"
],
"skills": [
"<string>"
],
"tool_categories": [
"<string>"
],
"suggested_prompts": [
"<string>"
],
"generate_runtime_key": true
}
'import requests
url = "https://api.example.com/v1/agents"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"execution_mode": "balanced",
"models": {},
"knowledge_bases": ["<string>"],
"skills": ["<string>"],
"tool_categories": ["<string>"],
"suggested_prompts": ["<string>"],
"generate_runtime_key": True
}
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>',
instructions: '<string>',
execution_mode: 'balanced',
models: {},
knowledge_bases: ['<string>'],
skills: ['<string>'],
tool_categories: ['<string>'],
suggested_prompts: ['<string>'],
generate_runtime_key: true
})
};
fetch('https://api.example.com/v1/agents', 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://api.example.com/v1/agents",
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>',
'instructions' => '<string>',
'execution_mode' => 'balanced',
'models' => [
],
'knowledge_bases' => [
'<string>'
],
'skills' => [
'<string>'
],
'tool_categories' => [
'<string>'
],
'suggested_prompts' => [
'<string>'
],
'generate_runtime_key' => true
]),
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://api.example.com/v1/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\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://api.example.com/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/agents")
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 \"instructions\": \"<string>\",\n \"execution_mode\": \"balanced\",\n \"models\": {},\n \"knowledge_bases\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"tool_categories\": [\n \"<string>\"\n ],\n \"suggested_prompts\": [\n \"<string>\"\n ],\n \"generate_runtime_key\": true\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": 123,
"user_id": 123,
"name": "<string>",
"execution_mode": "<string>",
"knowledge_bases": [
"<string>"
],
"skills": [
"<string>"
],
"tool_categories": [
"<string>"
],
"suggested_prompts": [
"<string>"
],
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"widget_enabled": true,
"allowed_domains": [
"<string>"
],
"share_enabled": true,
"share_updated_at": "<string>",
"description": "<string>",
"instructions": "<string>",
"models": {},
"logo_url": "<string>",
"published_at": "<string>"
},
"api_key": {
"full_key": "<string>",
"key_prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Body for POST /v1/agents.
Required string length:
1 - 200⌘I

