Get Sub Agents
curl --request POST \
--url https://api.example.com/api/sub-agents \
--header 'Content-Type: application/json' \
--header 'X-Session-API-Key: <api-key>' \
--data '
{
"load_builtin": true,
"load_project": true,
"load_user": true,
"project_dir": "<string>"
}
'import requests
url = "https://api.example.com/api/sub-agents"
payload = {
"load_builtin": True,
"load_project": True,
"load_user": True,
"project_dir": "<string>"
}
headers = {
"X-Session-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Session-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_builtin: true,
load_project: true,
load_user: true,
project_dir: '<string>'
})
};
fetch('https://api.example.com/api/sub-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/api/sub-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([
'load_builtin' => true,
'load_project' => true,
'load_user' => true,
'project_dir' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Session-API-Key: <api-key>"
],
]);
$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/api/sub-agents"
payload := strings.NewReader("{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Session-API-Key", "<api-key>")
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/api/sub-agents")
.header("X-Session-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sub-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Session-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agents": [
{
"name": "<string>",
"color": "<string>",
"condenser": {
"kind": "LLMSummarizingCondenser",
"llm": {
"is_subscription": true,
"api_key": "<string>",
"api_mode": "auto",
"api_version": "<string>",
"auth_type": "api_key",
"aws_access_key_id": "<string>",
"aws_bedrock_runtime_endpoint": "<string>",
"aws_profile_name": "<string>",
"aws_region_name": "<string>",
"aws_role_name": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_name": "<string>",
"aws_session_token": "<string>",
"base_url": "<string>",
"caching_prompt": true,
"capability_overrides": {},
"custom_tokenizer": "<string>",
"disable_stop_word": false,
"disable_vision": true,
"drop_params": true,
"enable_encrypted_reasoning": true,
"extended_thinking_budget": 200000,
"extra_headers": {},
"force_string_serializer": true,
"inline_image_urls": true,
"input_cost_per_token": 1,
"litellm_extra_body": {},
"log_completions": false,
"log_completions_folder": "logs/completions",
"max_input_tokens": 2,
"max_message_chars": 30000,
"max_output_tokens": 2,
"model": "gpt-5.6",
"model_canonical_name": "<string>",
"native_tool_calling": true,
"num_retries": 5,
"ollama_base_url": "<string>",
"openrouter_app_name": "OpenHands",
"openrouter_site_url": "https://docs.all-hands.dev/",
"output_cost_per_token": 1,
"prompt_cache_retention": "24h",
"provider_connection_id": "<string>",
"reasoning_effort": "high",
"reasoning_summary": "auto",
"retry_max_wait": 64,
"retry_min_wait": 8,
"retry_multiplier": 8,
"seed": 123,
"stream": false,
"stream_idle_timeout": 300,
"subscription_vendor": "openai",
"temperature": 1,
"timeout": 300,
"top_k": 1,
"top_p": 0.5,
"usage_id": "default"
},
"hard_context_reset_context_scaling": 0.8,
"hard_context_reset_max_retries": 5,
"keep_first": 2,
"max_size": 240,
"max_tokens": 123,
"minimum_progress": 0.1
},
"description": "",
"hooks": {
"post_tool_use": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"pre_tool_use": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"session_end": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"session_start": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"stop": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"user_prompt_submit": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
]
},
"is_builtin": false,
"level": "project",
"max_budget_per_run": 123,
"max_iteration_per_run": 123,
"mcp_config": {},
"mcp_servers": {},
"metadata": {},
"model": "inherit",
"permission_mode": "<string>",
"profile_store_dir": "<string>",
"skills": [
"<string>"
],
"source": "<string>",
"system_prompt": "",
"tools": [
"<string>"
],
"when_to_use_examples": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Sub Agents
Get Sub Agents
List file-based and built-in sub-agents for the workspace.
Merged first-wins by name with precedence project > user > builtin. Read-only: it registers nothing into the conversation registry.
POST
/
api
/
sub-agents
Get Sub Agents
curl --request POST \
--url https://api.example.com/api/sub-agents \
--header 'Content-Type: application/json' \
--header 'X-Session-API-Key: <api-key>' \
--data '
{
"load_builtin": true,
"load_project": true,
"load_user": true,
"project_dir": "<string>"
}
'import requests
url = "https://api.example.com/api/sub-agents"
payload = {
"load_builtin": True,
"load_project": True,
"load_user": True,
"project_dir": "<string>"
}
headers = {
"X-Session-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Session-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_builtin: true,
load_project: true,
load_user: true,
project_dir: '<string>'
})
};
fetch('https://api.example.com/api/sub-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/api/sub-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([
'load_builtin' => true,
'load_project' => true,
'load_user' => true,
'project_dir' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Session-API-Key: <api-key>"
],
]);
$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/api/sub-agents"
payload := strings.NewReader("{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Session-API-Key", "<api-key>")
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/api/sub-agents")
.header("X-Session-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/sub-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Session-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_builtin\": true,\n \"load_project\": true,\n \"load_user\": true,\n \"project_dir\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agents": [
{
"name": "<string>",
"color": "<string>",
"condenser": {
"kind": "LLMSummarizingCondenser",
"llm": {
"is_subscription": true,
"api_key": "<string>",
"api_mode": "auto",
"api_version": "<string>",
"auth_type": "api_key",
"aws_access_key_id": "<string>",
"aws_bedrock_runtime_endpoint": "<string>",
"aws_profile_name": "<string>",
"aws_region_name": "<string>",
"aws_role_name": "<string>",
"aws_secret_access_key": "<string>",
"aws_session_name": "<string>",
"aws_session_token": "<string>",
"base_url": "<string>",
"caching_prompt": true,
"capability_overrides": {},
"custom_tokenizer": "<string>",
"disable_stop_word": false,
"disable_vision": true,
"drop_params": true,
"enable_encrypted_reasoning": true,
"extended_thinking_budget": 200000,
"extra_headers": {},
"force_string_serializer": true,
"inline_image_urls": true,
"input_cost_per_token": 1,
"litellm_extra_body": {},
"log_completions": false,
"log_completions_folder": "logs/completions",
"max_input_tokens": 2,
"max_message_chars": 30000,
"max_output_tokens": 2,
"model": "gpt-5.6",
"model_canonical_name": "<string>",
"native_tool_calling": true,
"num_retries": 5,
"ollama_base_url": "<string>",
"openrouter_app_name": "OpenHands",
"openrouter_site_url": "https://docs.all-hands.dev/",
"output_cost_per_token": 1,
"prompt_cache_retention": "24h",
"provider_connection_id": "<string>",
"reasoning_effort": "high",
"reasoning_summary": "auto",
"retry_max_wait": 64,
"retry_min_wait": 8,
"retry_multiplier": 8,
"seed": 123,
"stream": false,
"stream_idle_timeout": 300,
"subscription_vendor": "openai",
"temperature": 1,
"timeout": 300,
"top_k": 1,
"top_p": 0.5,
"usage_id": "default"
},
"hard_context_reset_context_scaling": 0.8,
"hard_context_reset_max_retries": 5,
"keep_first": 2,
"max_size": 240,
"max_tokens": 123,
"minimum_progress": 0.1
},
"description": "",
"hooks": {
"post_tool_use": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"pre_tool_use": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"session_end": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"session_start": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"stop": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
],
"user_prompt_submit": [
{
"hooks": [
{
"command": "<string>",
"async": false,
"max_iterations": 3,
"name": "<string>",
"prompt": "<string>",
"system_prompt": "<string>",
"timeout": 60,
"tools": [
"<string>"
],
"type": "command"
}
],
"matcher": "*"
}
]
},
"is_builtin": false,
"level": "project",
"max_budget_per_run": 123,
"max_iteration_per_run": 123,
"mcp_config": {},
"mcp_servers": {},
"metadata": {},
"model": "inherit",
"permission_mode": "<string>",
"profile_store_dir": "<string>",
"skills": [
"<string>"
],
"source": "<string>",
"system_prompt": "",
"tools": [
"<string>"
],
"when_to_use_examples": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Body
application/json
Request body for listing sub-agents.
Load SDK built-in agents (general-purpose, code-explorer, ...)
Load project agents from the workspace
Load user agents from ~/.agents/agents and ~/.openhands/agents
Workspace directory path for project agents
Response
Successful Response
Response containing all available sub-agents.
Show child attributes
Show child attributes
Was this page helpful?

