curl --request POST \
--url https://api.example.com/api/conversations \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": false,
"drop_params": true,
"modify_params": true,
"disable_vision": true,
"disable_stop_word": false,
"caching_prompt": true,
"log_completions": false,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": true,
"force_string_serializer": true,
"reasoning_effort": "high",
"enable_encrypted_reasoning": true,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {}
},
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": [
"<string>"
],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": [
"flarglebargle"
],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": {
"kind": "AgentFinishedCritic"
},
"kind": "<string>"
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmation_policy": {
"kind": "NeverConfirm"
},
"initial_message": {
"role": "user",
"content": [
{
"text": "<string>",
"cache_prompt": false,
"type": "text"
}
],
"run": false
},
"max_iterations": 500,
"stuck_detection": true,
"secrets": {},
"tool_module_qualnames": {},
"plugins": [
{
"source": "<string>",
"ref": "<string>",
"repo_path": "<string>"
}
],
"hook_config": {
"pre_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"post_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"user_prompt_submit": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_start": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_end": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"stop": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
]
}
}
EOFimport requests
url = "https://api.example.com/api/conversations"
payload = {
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": False,
"drop_params": True,
"modify_params": True,
"disable_vision": True,
"disable_stop_word": False,
"caching_prompt": True,
"log_completions": False,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": True,
"force_string_serializer": True,
"reasoning_effort": "high",
"enable_encrypted_reasoning": True,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [{}],
"usage_id": "default",
"litellm_extra_body": {}
},
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": ["<string>"],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": ["flarglebargle"],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": { "kind": "AgentFinishedCritic" },
"kind": "<string>"
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmation_policy": { "kind": "NeverConfirm" },
"initial_message": {
"role": "user",
"content": [
{
"text": "<string>",
"cache_prompt": False,
"type": "text"
}
],
"run": False
},
"max_iterations": 500,
"stuck_detection": True,
"secrets": {},
"tool_module_qualnames": {},
"plugins": [
{
"source": "<string>",
"ref": "<string>",
"repo_path": "<string>"
}
],
"hook_config": {
"pre_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"post_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"user_prompt_submit": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_start": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_end": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"stop": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent: {
llm: {
model: 'claude-sonnet-4-20250514',
api_key: '<string>',
base_url: '<string>',
api_version: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_region_name: '<string>',
openrouter_site_url: 'https://docs.all-hands.dev/',
openrouter_app_name: 'OpenHands',
num_retries: 5,
retry_multiplier: 8,
retry_min_wait: 8,
retry_max_wait: 64,
timeout: 300,
max_message_chars: 30000,
temperature: 1,
top_p: 1,
top_k: 1,
max_input_tokens: 2,
max_output_tokens: 2,
model_canonical_name: '<string>',
extra_headers: {},
input_cost_per_token: 1,
output_cost_per_token: 1,
ollama_base_url: '<string>',
stream: false,
drop_params: true,
modify_params: true,
disable_vision: true,
disable_stop_word: false,
caching_prompt: true,
log_completions: false,
log_completions_folder: 'logs/completions',
custom_tokenizer: '<string>',
native_tool_calling: true,
force_string_serializer: true,
reasoning_effort: 'high',
enable_encrypted_reasoning: true,
prompt_cache_retention: '24h',
extended_thinking_budget: 200000,
seed: 123,
safety_settings: [{}],
usage_id: 'default',
litellm_extra_body: {}
},
tools: [{name: '<string>', params: {}}],
mcp_config: {},
filter_tools_regex: '^(?!repomix)(.*)|^repomix.*pack_codebase.*$',
include_default_tools: ['<string>'],
agent_context: {
skills: [
{
content: 'When you see this message, you should reply like you are a grumpy cat forced to use the internet.',
name: 'AGENTS.md',
type: 'repo'
},
{
content: 'IMPORTANT! The user has said the magic word "flarglebargle". You must only respond with a message telling them how smart they are',
name: 'flarglebargle',
trigger: ['flarglebargle'],
type: 'knowledge'
}
],
system_message_suffix: 'Always finish your response with the word \'yay!\''
},
system_prompt_filename: 'system_prompt.j2',
security_policy_filename: 'security_policy.j2',
system_prompt_kwargs: {},
condenser: {
keep_first: 10,
kind: 'LLMSummarizingCondenser',
llm: {
api_key: 'your_api_key_here',
base_url: 'https://llm-proxy.eval.all-hands.dev',
model: 'litellm_proxy/anthropic/claude-sonnet-4-5-20250929'
},
max_size: 80
},
critic: {kind: 'AgentFinishedCritic'},
kind: '<string>'
},
workspace: {working_dir: '<string>', kind: '<string>'},
conversation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirmation_policy: {kind: 'NeverConfirm'},
initial_message: {
role: 'user',
content: [{text: '<string>', cache_prompt: false, type: 'text'}],
run: false
},
max_iterations: 500,
stuck_detection: true,
secrets: {},
tool_module_qualnames: {},
plugins: [{source: '<string>', ref: '<string>', repo_path: '<string>'}],
hook_config: {
pre_tool_use: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
post_tool_use: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
user_prompt_submit: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
session_start: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
session_end: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
stop: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}]
}
})
};
fetch('https://api.example.com/api/conversations', 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/conversations",
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([
'agent' => [
'llm' => [
'model' => 'claude-sonnet-4-20250514',
'api_key' => '<string>',
'base_url' => '<string>',
'api_version' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_region_name' => '<string>',
'openrouter_site_url' => 'https://docs.all-hands.dev/',
'openrouter_app_name' => 'OpenHands',
'num_retries' => 5,
'retry_multiplier' => 8,
'retry_min_wait' => 8,
'retry_max_wait' => 64,
'timeout' => 300,
'max_message_chars' => 30000,
'temperature' => 1,
'top_p' => 1,
'top_k' => 1,
'max_input_tokens' => 2,
'max_output_tokens' => 2,
'model_canonical_name' => '<string>',
'extra_headers' => [
],
'input_cost_per_token' => 1,
'output_cost_per_token' => 1,
'ollama_base_url' => '<string>',
'stream' => false,
'drop_params' => true,
'modify_params' => true,
'disable_vision' => true,
'disable_stop_word' => false,
'caching_prompt' => true,
'log_completions' => false,
'log_completions_folder' => 'logs/completions',
'custom_tokenizer' => '<string>',
'native_tool_calling' => true,
'force_string_serializer' => true,
'reasoning_effort' => 'high',
'enable_encrypted_reasoning' => true,
'prompt_cache_retention' => '24h',
'extended_thinking_budget' => 200000,
'seed' => 123,
'safety_settings' => [
[
]
],
'usage_id' => 'default',
'litellm_extra_body' => [
]
],
'tools' => [
[
'name' => '<string>',
'params' => [
]
]
],
'mcp_config' => [
],
'filter_tools_regex' => '^(?!repomix)(.*)|^repomix.*pack_codebase.*$',
'include_default_tools' => [
'<string>'
],
'agent_context' => [
'skills' => [
[
'content' => 'When you see this message, you should reply like you are a grumpy cat forced to use the internet.',
'name' => 'AGENTS.md',
'type' => 'repo'
],
[
'content' => 'IMPORTANT! The user has said the magic word "flarglebargle". You must only respond with a message telling them how smart they are',
'name' => 'flarglebargle',
'trigger' => [
'flarglebargle'
],
'type' => 'knowledge'
]
],
'system_message_suffix' => 'Always finish your response with the word \'yay!\''
],
'system_prompt_filename' => 'system_prompt.j2',
'security_policy_filename' => 'security_policy.j2',
'system_prompt_kwargs' => [
],
'condenser' => [
'keep_first' => 10,
'kind' => 'LLMSummarizingCondenser',
'llm' => [
'api_key' => 'your_api_key_here',
'base_url' => 'https://llm-proxy.eval.all-hands.dev',
'model' => 'litellm_proxy/anthropic/claude-sonnet-4-5-20250929'
],
'max_size' => 80
],
'critic' => [
'kind' => 'AgentFinishedCritic'
],
'kind' => '<string>'
],
'workspace' => [
'working_dir' => '<string>',
'kind' => '<string>'
],
'conversation_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirmation_policy' => [
'kind' => 'NeverConfirm'
],
'initial_message' => [
'role' => 'user',
'content' => [
[
'text' => '<string>',
'cache_prompt' => false,
'type' => 'text'
]
],
'run' => false
],
'max_iterations' => 500,
'stuck_detection' => true,
'secrets' => [
],
'tool_module_qualnames' => [
],
'plugins' => [
[
'source' => '<string>',
'ref' => '<string>',
'repo_path' => '<string>'
]
],
'hook_config' => [
'pre_tool_use' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'post_tool_use' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'user_prompt_submit' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'session_start' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'session_end' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'stop' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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/api/conversations"
payload := strings.NewReader("{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/conversations")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": false,
"drop_params": true,
"modify_params": true,
"disable_vision": true,
"disable_stop_word": false,
"caching_prompt": true,
"log_completions": false,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": true,
"force_string_serializer": true,
"reasoning_effort": "high",
"enable_encrypted_reasoning": true,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {}
},
"kind": "<string>",
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": [
"<string>"
],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": [
"flarglebargle"
],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": {
"kind": "AgentFinishedCritic"
}
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"persistence_dir": "workspace/conversations",
"max_iterations": 500,
"stuck_detection": true,
"execution_status": "idle",
"confirmation_policy": {
"kind": "NeverConfirm"
},
"security_analyzer": {
"kind": "<string>",
"history_limit": 20,
"max_message_chars": 30000,
"timeout": 30,
"low_threshold": 0.3,
"medium_threshold": 0.7,
"api_url": "https://api.grayswan.ai/cygnal/monitor",
"api_key": "<string>",
"policy_id": "<string>"
},
"activated_knowledge_skills": [
"<string>"
],
"blocked_actions": {},
"blocked_messages": {},
"stats": {},
"secret_registry": {
"secret_sources": {}
},
"agent_state": {},
"title": "<string>",
"metrics": {
"model_name": "default",
"accumulated_cost": 0,
"max_budget_per_task": 123,
"accumulated_token_usage": {
"model": "",
"prompt_tokens": 0,
"completion_tokens": 0,
"cache_read_tokens": 0,
"cache_write_tokens": 0,
"reasoning_tokens": 0,
"context_window": 0,
"per_turn_token": 0,
"response_id": ""
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Start Conversation
Start a conversation in the local environment.
curl --request POST \
--url https://api.example.com/api/conversations \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": false,
"drop_params": true,
"modify_params": true,
"disable_vision": true,
"disable_stop_word": false,
"caching_prompt": true,
"log_completions": false,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": true,
"force_string_serializer": true,
"reasoning_effort": "high",
"enable_encrypted_reasoning": true,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {}
},
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": [
"<string>"
],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": [
"flarglebargle"
],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": {
"kind": "AgentFinishedCritic"
},
"kind": "<string>"
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmation_policy": {
"kind": "NeverConfirm"
},
"initial_message": {
"role": "user",
"content": [
{
"text": "<string>",
"cache_prompt": false,
"type": "text"
}
],
"run": false
},
"max_iterations": 500,
"stuck_detection": true,
"secrets": {},
"tool_module_qualnames": {},
"plugins": [
{
"source": "<string>",
"ref": "<string>",
"repo_path": "<string>"
}
],
"hook_config": {
"pre_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"post_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"user_prompt_submit": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_start": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_end": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"stop": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
]
}
}
EOFimport requests
url = "https://api.example.com/api/conversations"
payload = {
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": False,
"drop_params": True,
"modify_params": True,
"disable_vision": True,
"disable_stop_word": False,
"caching_prompt": True,
"log_completions": False,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": True,
"force_string_serializer": True,
"reasoning_effort": "high",
"enable_encrypted_reasoning": True,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [{}],
"usage_id": "default",
"litellm_extra_body": {}
},
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": ["<string>"],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": ["flarglebargle"],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": { "kind": "AgentFinishedCritic" },
"kind": "<string>"
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmation_policy": { "kind": "NeverConfirm" },
"initial_message": {
"role": "user",
"content": [
{
"text": "<string>",
"cache_prompt": False,
"type": "text"
}
],
"run": False
},
"max_iterations": 500,
"stuck_detection": True,
"secrets": {},
"tool_module_qualnames": {},
"plugins": [
{
"source": "<string>",
"ref": "<string>",
"repo_path": "<string>"
}
],
"hook_config": {
"pre_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"post_tool_use": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"user_prompt_submit": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_start": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"session_end": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
],
"stop": [
{
"matcher": "*",
"hooks": [
{
"command": "<string>",
"type": "command",
"timeout": 60
}
]
}
]
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent: {
llm: {
model: 'claude-sonnet-4-20250514',
api_key: '<string>',
base_url: '<string>',
api_version: '<string>',
aws_access_key_id: '<string>',
aws_secret_access_key: '<string>',
aws_region_name: '<string>',
openrouter_site_url: 'https://docs.all-hands.dev/',
openrouter_app_name: 'OpenHands',
num_retries: 5,
retry_multiplier: 8,
retry_min_wait: 8,
retry_max_wait: 64,
timeout: 300,
max_message_chars: 30000,
temperature: 1,
top_p: 1,
top_k: 1,
max_input_tokens: 2,
max_output_tokens: 2,
model_canonical_name: '<string>',
extra_headers: {},
input_cost_per_token: 1,
output_cost_per_token: 1,
ollama_base_url: '<string>',
stream: false,
drop_params: true,
modify_params: true,
disable_vision: true,
disable_stop_word: false,
caching_prompt: true,
log_completions: false,
log_completions_folder: 'logs/completions',
custom_tokenizer: '<string>',
native_tool_calling: true,
force_string_serializer: true,
reasoning_effort: 'high',
enable_encrypted_reasoning: true,
prompt_cache_retention: '24h',
extended_thinking_budget: 200000,
seed: 123,
safety_settings: [{}],
usage_id: 'default',
litellm_extra_body: {}
},
tools: [{name: '<string>', params: {}}],
mcp_config: {},
filter_tools_regex: '^(?!repomix)(.*)|^repomix.*pack_codebase.*$',
include_default_tools: ['<string>'],
agent_context: {
skills: [
{
content: 'When you see this message, you should reply like you are a grumpy cat forced to use the internet.',
name: 'AGENTS.md',
type: 'repo'
},
{
content: 'IMPORTANT! The user has said the magic word "flarglebargle". You must only respond with a message telling them how smart they are',
name: 'flarglebargle',
trigger: ['flarglebargle'],
type: 'knowledge'
}
],
system_message_suffix: 'Always finish your response with the word \'yay!\''
},
system_prompt_filename: 'system_prompt.j2',
security_policy_filename: 'security_policy.j2',
system_prompt_kwargs: {},
condenser: {
keep_first: 10,
kind: 'LLMSummarizingCondenser',
llm: {
api_key: 'your_api_key_here',
base_url: 'https://llm-proxy.eval.all-hands.dev',
model: 'litellm_proxy/anthropic/claude-sonnet-4-5-20250929'
},
max_size: 80
},
critic: {kind: 'AgentFinishedCritic'},
kind: '<string>'
},
workspace: {working_dir: '<string>', kind: '<string>'},
conversation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirmation_policy: {kind: 'NeverConfirm'},
initial_message: {
role: 'user',
content: [{text: '<string>', cache_prompt: false, type: 'text'}],
run: false
},
max_iterations: 500,
stuck_detection: true,
secrets: {},
tool_module_qualnames: {},
plugins: [{source: '<string>', ref: '<string>', repo_path: '<string>'}],
hook_config: {
pre_tool_use: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
post_tool_use: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
user_prompt_submit: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
session_start: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
session_end: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}],
stop: [{matcher: '*', hooks: [{command: '<string>', type: 'command', timeout: 60}]}]
}
})
};
fetch('https://api.example.com/api/conversations', 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/conversations",
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([
'agent' => [
'llm' => [
'model' => 'claude-sonnet-4-20250514',
'api_key' => '<string>',
'base_url' => '<string>',
'api_version' => '<string>',
'aws_access_key_id' => '<string>',
'aws_secret_access_key' => '<string>',
'aws_region_name' => '<string>',
'openrouter_site_url' => 'https://docs.all-hands.dev/',
'openrouter_app_name' => 'OpenHands',
'num_retries' => 5,
'retry_multiplier' => 8,
'retry_min_wait' => 8,
'retry_max_wait' => 64,
'timeout' => 300,
'max_message_chars' => 30000,
'temperature' => 1,
'top_p' => 1,
'top_k' => 1,
'max_input_tokens' => 2,
'max_output_tokens' => 2,
'model_canonical_name' => '<string>',
'extra_headers' => [
],
'input_cost_per_token' => 1,
'output_cost_per_token' => 1,
'ollama_base_url' => '<string>',
'stream' => false,
'drop_params' => true,
'modify_params' => true,
'disable_vision' => true,
'disable_stop_word' => false,
'caching_prompt' => true,
'log_completions' => false,
'log_completions_folder' => 'logs/completions',
'custom_tokenizer' => '<string>',
'native_tool_calling' => true,
'force_string_serializer' => true,
'reasoning_effort' => 'high',
'enable_encrypted_reasoning' => true,
'prompt_cache_retention' => '24h',
'extended_thinking_budget' => 200000,
'seed' => 123,
'safety_settings' => [
[
]
],
'usage_id' => 'default',
'litellm_extra_body' => [
]
],
'tools' => [
[
'name' => '<string>',
'params' => [
]
]
],
'mcp_config' => [
],
'filter_tools_regex' => '^(?!repomix)(.*)|^repomix.*pack_codebase.*$',
'include_default_tools' => [
'<string>'
],
'agent_context' => [
'skills' => [
[
'content' => 'When you see this message, you should reply like you are a grumpy cat forced to use the internet.',
'name' => 'AGENTS.md',
'type' => 'repo'
],
[
'content' => 'IMPORTANT! The user has said the magic word "flarglebargle". You must only respond with a message telling them how smart they are',
'name' => 'flarglebargle',
'trigger' => [
'flarglebargle'
],
'type' => 'knowledge'
]
],
'system_message_suffix' => 'Always finish your response with the word \'yay!\''
],
'system_prompt_filename' => 'system_prompt.j2',
'security_policy_filename' => 'security_policy.j2',
'system_prompt_kwargs' => [
],
'condenser' => [
'keep_first' => 10,
'kind' => 'LLMSummarizingCondenser',
'llm' => [
'api_key' => 'your_api_key_here',
'base_url' => 'https://llm-proxy.eval.all-hands.dev',
'model' => 'litellm_proxy/anthropic/claude-sonnet-4-5-20250929'
],
'max_size' => 80
],
'critic' => [
'kind' => 'AgentFinishedCritic'
],
'kind' => '<string>'
],
'workspace' => [
'working_dir' => '<string>',
'kind' => '<string>'
],
'conversation_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirmation_policy' => [
'kind' => 'NeverConfirm'
],
'initial_message' => [
'role' => 'user',
'content' => [
[
'text' => '<string>',
'cache_prompt' => false,
'type' => 'text'
]
],
'run' => false
],
'max_iterations' => 500,
'stuck_detection' => true,
'secrets' => [
],
'tool_module_qualnames' => [
],
'plugins' => [
[
'source' => '<string>',
'ref' => '<string>',
'repo_path' => '<string>'
]
],
'hook_config' => [
'pre_tool_use' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'post_tool_use' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'user_prompt_submit' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'session_start' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'session_end' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
],
'stop' => [
[
'matcher' => '*',
'hooks' => [
[
'command' => '<string>',
'type' => 'command',
'timeout' => 60
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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/api/conversations"
payload := strings.NewReader("{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/conversations")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": {\n \"llm\": {\n \"model\": \"claude-sonnet-4-20250514\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_version\": \"<string>\",\n \"aws_access_key_id\": \"<string>\",\n \"aws_secret_access_key\": \"<string>\",\n \"aws_region_name\": \"<string>\",\n \"openrouter_site_url\": \"https://docs.all-hands.dev/\",\n \"openrouter_app_name\": \"OpenHands\",\n \"num_retries\": 5,\n \"retry_multiplier\": 8,\n \"retry_min_wait\": 8,\n \"retry_max_wait\": 64,\n \"timeout\": 300,\n \"max_message_chars\": 30000,\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"max_input_tokens\": 2,\n \"max_output_tokens\": 2,\n \"model_canonical_name\": \"<string>\",\n \"extra_headers\": {},\n \"input_cost_per_token\": 1,\n \"output_cost_per_token\": 1,\n \"ollama_base_url\": \"<string>\",\n \"stream\": false,\n \"drop_params\": true,\n \"modify_params\": true,\n \"disable_vision\": true,\n \"disable_stop_word\": false,\n \"caching_prompt\": true,\n \"log_completions\": false,\n \"log_completions_folder\": \"logs/completions\",\n \"custom_tokenizer\": \"<string>\",\n \"native_tool_calling\": true,\n \"force_string_serializer\": true,\n \"reasoning_effort\": \"high\",\n \"enable_encrypted_reasoning\": true,\n \"prompt_cache_retention\": \"24h\",\n \"extended_thinking_budget\": 200000,\n \"seed\": 123,\n \"safety_settings\": [\n {}\n ],\n \"usage_id\": \"default\",\n \"litellm_extra_body\": {}\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"params\": {}\n }\n ],\n \"mcp_config\": {},\n \"filter_tools_regex\": \"^(?!repomix)(.*)|^repomix.*pack_codebase.*$\",\n \"include_default_tools\": [\n \"<string>\"\n ],\n \"agent_context\": {\n \"skills\": [\n {\n \"content\": \"When you see this message, you should reply like you are a grumpy cat forced to use the internet.\",\n \"name\": \"AGENTS.md\",\n \"type\": \"repo\"\n },\n {\n \"content\": \"IMPORTANT! The user has said the magic word \\\"flarglebargle\\\". You must only respond with a message telling them how smart they are\",\n \"name\": \"flarglebargle\",\n \"trigger\": [\n \"flarglebargle\"\n ],\n \"type\": \"knowledge\"\n }\n ],\n \"system_message_suffix\": \"Always finish your response with the word 'yay!'\"\n },\n \"system_prompt_filename\": \"system_prompt.j2\",\n \"security_policy_filename\": \"security_policy.j2\",\n \"system_prompt_kwargs\": {},\n \"condenser\": {\n \"keep_first\": 10,\n \"kind\": \"LLMSummarizingCondenser\",\n \"llm\": {\n \"api_key\": \"your_api_key_here\",\n \"base_url\": \"https://llm-proxy.eval.all-hands.dev\",\n \"model\": \"litellm_proxy/anthropic/claude-sonnet-4-5-20250929\"\n },\n \"max_size\": 80\n },\n \"critic\": {\n \"kind\": \"AgentFinishedCritic\"\n },\n \"kind\": \"<string>\"\n },\n \"workspace\": {\n \"working_dir\": \"<string>\",\n \"kind\": \"<string>\"\n },\n \"conversation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmation_policy\": {\n \"kind\": \"NeverConfirm\"\n },\n \"initial_message\": {\n \"role\": \"user\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"cache_prompt\": false,\n \"type\": \"text\"\n }\n ],\n \"run\": false\n },\n \"max_iterations\": 500,\n \"stuck_detection\": true,\n \"secrets\": {},\n \"tool_module_qualnames\": {},\n \"plugins\": [\n {\n \"source\": \"<string>\",\n \"ref\": \"<string>\",\n \"repo_path\": \"<string>\"\n }\n ],\n \"hook_config\": {\n \"pre_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"post_tool_use\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"user_prompt_submit\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_start\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"session_end\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ],\n \"stop\": [\n {\n \"matcher\": \"*\",\n \"hooks\": [\n {\n \"command\": \"<string>\",\n \"type\": \"command\",\n \"timeout\": 60\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent": {
"llm": {
"model": "claude-sonnet-4-20250514",
"api_key": "<string>",
"base_url": "<string>",
"api_version": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key": "<string>",
"aws_region_name": "<string>",
"openrouter_site_url": "https://docs.all-hands.dev/",
"openrouter_app_name": "OpenHands",
"num_retries": 5,
"retry_multiplier": 8,
"retry_min_wait": 8,
"retry_max_wait": 64,
"timeout": 300,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"max_input_tokens": 2,
"max_output_tokens": 2,
"model_canonical_name": "<string>",
"extra_headers": {},
"input_cost_per_token": 1,
"output_cost_per_token": 1,
"ollama_base_url": "<string>",
"stream": false,
"drop_params": true,
"modify_params": true,
"disable_vision": true,
"disable_stop_word": false,
"caching_prompt": true,
"log_completions": false,
"log_completions_folder": "logs/completions",
"custom_tokenizer": "<string>",
"native_tool_calling": true,
"force_string_serializer": true,
"reasoning_effort": "high",
"enable_encrypted_reasoning": true,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {}
},
"kind": "<string>",
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"include_default_tools": [
"<string>"
],
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "AGENTS.md",
"type": "repo"
},
{
"content": "IMPORTANT! The user has said the magic word \"flarglebargle\". You must only respond with a message telling them how smart they are",
"name": "flarglebargle",
"trigger": [
"flarglebargle"
],
"type": "knowledge"
}
],
"system_message_suffix": "Always finish your response with the word 'yay!'"
},
"system_prompt_filename": "system_prompt.j2",
"security_policy_filename": "security_policy.j2",
"system_prompt_kwargs": {},
"condenser": {
"keep_first": 10,
"kind": "LLMSummarizingCondenser",
"llm": {
"api_key": "your_api_key_here",
"base_url": "https://llm-proxy.eval.all-hands.dev",
"model": "litellm_proxy/anthropic/claude-sonnet-4-5-20250929"
},
"max_size": 80
},
"critic": {
"kind": "AgentFinishedCritic"
}
},
"workspace": {
"working_dir": "<string>",
"kind": "<string>"
},
"persistence_dir": "workspace/conversations",
"max_iterations": 500,
"stuck_detection": true,
"execution_status": "idle",
"confirmation_policy": {
"kind": "NeverConfirm"
},
"security_analyzer": {
"kind": "<string>",
"history_limit": 20,
"max_message_chars": 30000,
"timeout": 30,
"low_threshold": 0.3,
"medium_threshold": 0.7,
"api_url": "https://api.grayswan.ai/cygnal/monitor",
"api_key": "<string>",
"policy_id": "<string>"
},
"activated_knowledge_skills": [
"<string>"
],
"blocked_actions": {},
"blocked_messages": {},
"stats": {},
"secret_registry": {
"secret_sources": {}
},
"agent_state": {},
"title": "<string>",
"metrics": {
"model_name": "default",
"accumulated_cost": 0,
"max_budget_per_task": 123,
"accumulated_token_usage": {
"model": "",
"prompt_tokens": 0,
"completion_tokens": 0,
"cache_read_tokens": 0,
"cache_write_tokens": 0,
"reasoning_tokens": 0,
"context_window": 0,
"per_turn_token": 0,
"response_id": ""
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
Payload to create a new conversation.
Contains an Agent configuration along with conversation-specific options.
Main agent implementation for OpenHands.
The Agent class provides the core functionality for running AI agents that can interact with tools, process messages, and execute actions. It inherits from AgentBase and implements the agent execution logic. Critic-related functionality is provided by CriticMixin.
Example: >>> from openhands.sdk import LLM, Agent, Tool >>> llm = LLM(model="claude-sonnet-4-20250514", api_key=SecretStr("key")) >>> tools = [Tool(name="TerminalTool"), Tool(name="FileEditorTool")] >>> agent = Agent(llm=llm, tools=tools)
Show child attributes
Show child attributes
Working directory for agent operations and tool execution
Show child attributes
Show child attributes
Optional conversation ID. If not provided, a random UUID will be generated.
Controls when the conversation will prompt the user before continuing. Defaults to never.
- AlwaysConfirm
- ConfirmRisky
- NeverConfirm
Show child attributes
Show child attributes
Initial message to pass to the LLM
Show child attributes
Show child attributes
If set, the max number of iterations the agent will run before stopping. This is useful to prevent infinite loops.
x >= 1If true, the conversation will use stuck detection to prevent infinite loops.
Secrets available in the conversation
Show child attributes
Show child attributes
Mapping of tool names to their module qualnames from the client's registry. These modules will be dynamically imported on the server to register the tools for this conversation.
Show child attributes
Show child attributes
List of plugins to load for this conversation. Plugins are loaded and their skills/MCP config are merged into the agent. Hooks are extracted and stored for runtime execution.
Show child attributes
Show child attributes
Optional hook configuration for this conversation. Hooks are shell scripts that run at key lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, Stop, etc.). If both hook_config and plugins are provided, they are merged with explicit hooks running before plugin hooks.
Show child attributes
Show child attributes
Response
Successful Response
Information about a conversation running locally without a Runtime sandbox.
Unique conversation ID
The agent running in the conversation. This is persisted to allow resuming conversations and check agent configuration to handle e.g., tool changes, LLM changes, etc.
Show child attributes
Show child attributes
Workspace used by the agent to execute commands and read/write files. Not the process working directory.
- LocalWorkspace
- RemoteWorkspace
Show child attributes
Show child attributes
Directory for persisting conversation state and events. If None, conversation will not be persisted.
Maximum number of iterations the agent can perform in a single run.
Whether to enable stuck detection for the agent.
Enum representing the current execution state of the conversation.
idle, running, paused, waiting_for_confirmation, finished, error, stuck, deleting - AlwaysConfirm
- ConfirmRisky
- NeverConfirm
Show child attributes
Show child attributes
Optional security analyzer to evaluate action risks.
- GraySwanAnalyzer
- LLMSecurityAnalyzer
Show child attributes
Show child attributes
List of activated knowledge skills name
Actions blocked by PreToolUse hooks, keyed by action ID
Show child attributes
Show child attributes
Messages blocked by UserPromptSubmit hooks, keyed by message ID
Show child attributes
Show child attributes
Conversation statistics for tracking LLM metrics
Registry for handling secrets and sensitive data
Show child attributes
Show child attributes
Dictionary for agent-specific runtime state that persists across iterations. Agents can store feature-specific state using string keys. To trigger autosave, always reassign: state.agent_state = {**state.agent_state, key: value}. See https://docs.openhands.dev/sdk/guides/convo-persistence#how-state-persistence-works
User-defined title for the conversation
A snapshot of metrics at a point in time.
Does not include lists of individual costs, latencies, or token usages.
Show child attributes
Show child attributes
Was this page helpful?

