curl --request POST \
--url https://api.{domain}/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "reviewer",
"model": "MiniMax-M3",
"instructions": "Review diffs. Never modify files."
}
'import requests
url = "https://api.{domain}/v1/agents"
payload = {
"name": "reviewer",
"model": "MiniMax-M3",
"instructions": "Review diffs. Never modify files."
}
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: 'reviewer',
model: 'MiniMax-M3',
instructions: 'Review diffs. Never modify files.'
})
};
fetch('https://api.{domain}/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.{domain}/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' => 'reviewer',
'model' => 'MiniMax-M3',
'instructions' => 'Review diffs. Never modify files.'
]),
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.{domain}/v1/agents"
payload := strings.NewReader("{\n \"name\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\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.{domain}/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{domain}/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\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\n}"
response = http.request(request)
puts response.read_body{
"object": "agent",
"id": "<string>",
"name": "<string>",
"model": "<string>",
"model_credential_id": "<string>",
"instructions": "<string>",
"tools": [
{
"type": "mcp",
"name": "<string>",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"required": true,
"redacted": [
"<string>"
],
"description": "<string>",
"parameters": {},
"timeout_seconds": 123
}
],
"text": {},
"created_at": 123
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}Create or replace an agent
Create or replace a named agent.
curl --request POST \
--url https://api.{domain}/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "reviewer",
"model": "MiniMax-M3",
"instructions": "Review diffs. Never modify files."
}
'import requests
url = "https://api.{domain}/v1/agents"
payload = {
"name": "reviewer",
"model": "MiniMax-M3",
"instructions": "Review diffs. Never modify files."
}
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: 'reviewer',
model: 'MiniMax-M3',
instructions: 'Review diffs. Never modify files.'
})
};
fetch('https://api.{domain}/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.{domain}/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' => 'reviewer',
'model' => 'MiniMax-M3',
'instructions' => 'Review diffs. Never modify files.'
]),
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.{domain}/v1/agents"
payload := strings.NewReader("{\n \"name\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\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.{domain}/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{domain}/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\": \"reviewer\",\n \"model\": \"MiniMax-M3\",\n \"instructions\": \"Review diffs. Never modify files.\"\n}"
response = http.request(request)
puts response.read_body{
"object": "agent",
"id": "<string>",
"name": "<string>",
"model": "<string>",
"model_credential_id": "<string>",
"instructions": "<string>",
"tools": [
{
"type": "mcp",
"name": "<string>",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"required": true,
"redacted": [
"<string>"
],
"description": "<string>",
"parameters": {},
"timeout_seconds": 123
}
],
"text": {},
"created_at": 123
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
A gbr_pat_ access token. Scopes are recorded on the token when it is minted.
Headers
Retrying with the same key replays the first answer instead of acting again.
255Body
Yours, for recognising it.
Must be one the chosen credential runs. A session started from this agent may override it.
Omit to use the organization's default.
Standing instructions every session started from this agent begins with.
32000What the agent may reach outside the workspace: your own functions, MCP servers, and which built-ins. Everything inside the workspace — shell, files, git — is always there and is not configured here.
Show child attributes
Show child attributes
Shaping the final message: how much it says, and whether it must conform to a JSON Schema.
Show child attributes
Show child attributes
Response
Create or replace a named agent.
Always agent. Names the shape, so a value can be identified without knowing which call returned it.
"agent"Ours. Pass it as agent.id when creating a session.
Yours, for recognising it. Not an identifier.
The model sessions from this agent run on, unless they override it.
The connection to run on. Null uses the organization's default.
Standing instructions given to every session started from this agent.
32000Tools every session started from this agent gets, unless it replaces them. Secrets are withheld — see redacted on an entry.
Show child attributes
Show child attributes
Output shaping copied into every session started from this agent.
Unix milliseconds.