Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.agents.create_agent(name="release-research-agent", model="functionary-pt", description="Looks up current release information before answering.", instructions="Use web search when the question depends on current external information.", tools=[
{
"type": "web_search",
"search_context_size": "medium",
},
], tool_choice="auto", parallel_tool_calls=True)
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agents.createAgent({
createAgentRequest: {
name: "release-research-agent",
description: "Looks up current release information before answering.",
model: "functionary-pt",
instructions: "Use web search when the question depends on current external information.",
tools: [
{
type: "web_search",
searchContextSize: "medium",
},
],
toolChoice: "auto",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Agents.CreateAgentAsync(body: new MeetKai.MKA1.Types.Components.CreateAgentRequest() {
Name = "release-research-agent",
Description = "Looks up current release information before answering.",
Model = "functionary-pt",
Instructions = "Use web search when the question depends on current external information.",
Tools = new List<ToolDefinitionUnion>() {
ToolDefinitionUnion.CreateToolDefinition1(
new ToolDefinition1() {
Type = ToolDefinitionType1.WebSearch,
SearchContextSize = ToolDefinitionSearchContextSize.Medium,
}
),
},
ToolChoice = "auto",
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "release-research-agent",
"description": "Looks up current release information before answering.",
"model": "functionary-pt",
"instructions": "Use web search when the question depends on current external information.",
"tools": [
{
"type": "web_search",
"search_context_size": "medium"
}
],
"tool_choice": "auto",
"parallel_tool_calls": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'release-research-agent',
description: 'Looks up current release information before answering.',
model: 'functionary-pt',
instructions: 'Use web search when the question depends on current external information.',
tools: [{type: 'web_search', search_context_size: 'medium'}],
tool_choice: 'auto',
parallel_tool_calls: true
})
};
fetch('https://apigw.mka1.com/api/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://apigw.mka1.com/api/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' => 'release-research-agent',
'description' => 'Looks up current release information before answering.',
'model' => 'functionary-pt',
'instructions' => 'Use web search when the question depends on current external information.',
'tools' => [
[
'type' => 'web_search',
'search_context_size' => 'medium'
]
],
'tool_choice' => 'auto',
'parallel_tool_calls' => 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://apigw.mka1.com/api/v1/agents"
payload := strings.NewReader("{\n \"name\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": 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://apigw.mka1.com/api/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/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\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "agent",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"model": "functionary-pt",
"instructions": "<string>",
"tools": [
{
"user_location": {
"type": "approximate",
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"filters": {
"allowed_domains": [
"<string>"
]
}
}
],
"tool_choice": "<unknown>",
"parallel_tool_calls": true,
"max_tool_calls": 123,
"text": {
"format": {}
},
"reasoning": {},
"metadata": {},
"version": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}Agents
Create an agent
POST
/
api
/
v1
/
agents
Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.agents.create_agent(name="release-research-agent", model="functionary-pt", description="Looks up current release information before answering.", instructions="Use web search when the question depends on current external information.", tools=[
{
"type": "web_search",
"search_context_size": "medium",
},
], tool_choice="auto", parallel_tool_calls=True)
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agents.createAgent({
createAgentRequest: {
name: "release-research-agent",
description: "Looks up current release information before answering.",
model: "functionary-pt",
instructions: "Use web search when the question depends on current external information.",
tools: [
{
type: "web_search",
searchContextSize: "medium",
},
],
toolChoice: "auto",
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Agents.CreateAgentAsync(body: new MeetKai.MKA1.Types.Components.CreateAgentRequest() {
Name = "release-research-agent",
Description = "Looks up current release information before answering.",
Model = "functionary-pt",
Instructions = "Use web search when the question depends on current external information.",
Tools = new List<ToolDefinitionUnion>() {
ToolDefinitionUnion.CreateToolDefinition1(
new ToolDefinition1() {
Type = ToolDefinitionType1.WebSearch,
SearchContextSize = ToolDefinitionSearchContextSize.Medium,
}
),
},
ToolChoice = "auto",
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "release-research-agent",
"description": "Looks up current release information before answering.",
"model": "functionary-pt",
"instructions": "Use web search when the question depends on current external information.",
"tools": [
{
"type": "web_search",
"search_context_size": "medium"
}
],
"tool_choice": "auto",
"parallel_tool_calls": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'release-research-agent',
description: 'Looks up current release information before answering.',
model: 'functionary-pt',
instructions: 'Use web search when the question depends on current external information.',
tools: [{type: 'web_search', search_context_size: 'medium'}],
tool_choice: 'auto',
parallel_tool_calls: true
})
};
fetch('https://apigw.mka1.com/api/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://apigw.mka1.com/api/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' => 'release-research-agent',
'description' => 'Looks up current release information before answering.',
'model' => 'functionary-pt',
'instructions' => 'Use web search when the question depends on current external information.',
'tools' => [
[
'type' => 'web_search',
'search_context_size' => 'medium'
]
],
'tool_choice' => 'auto',
'parallel_tool_calls' => 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://apigw.mka1.com/api/v1/agents"
payload := strings.NewReader("{\n \"name\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": 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://apigw.mka1.com/api/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/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\": \"release-research-agent\",\n \"description\": \"Looks up current release information before answering.\",\n \"model\": \"functionary-pt\",\n \"instructions\": \"Use web search when the question depends on current external information.\",\n \"tools\": [\n {\n \"type\": \"web_search\",\n \"search_context_size\": \"medium\"\n }\n ],\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "agent",
"id": "<string>",
"name": "<string>",
"description": "<string>",
"model": "functionary-pt",
"instructions": "<string>",
"tools": [
{
"user_location": {
"type": "approximate",
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"filters": {
"allowed_domains": [
"<string>"
]
}
}
],
"tool_choice": "<unknown>",
"parallel_tool_calls": true,
"max_tool_calls": 123,
"text": {
"format": {}
},
"reasoning": {},
"metadata": {},
"version": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Headers
Optional external end-user identifier forwarded by the API gateway.
Body
application/json
Required string length:
1 - 120Minimum string length:
1Example:
"functionary-pt"
Maximum string length:
2000Maximum string length:
20000- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
Arbitrary JSON value.
Required range:
1 <= x <= 300Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Agent created.
Available options:
agent Example:
"functionary-pt"
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
Arbitrary JSON value.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Current configuration version. Incremented on every update or rollback.
Required range:
x >= 1Was this page helpful?
⌘I