{
"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": 1,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"custom_llm_provider": "<string>",
"max_input_tokens": 2,
"max_output_tokens": 2,
"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",
"reasoning_summary": "auto",
"enable_encrypted_reasoning": false,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {},
"OVERRIDE_ON_SERIALIZE": [
"api_key",
"aws_access_key_id",
"aws_secret_access_key",
"litellm_extra_body"
]
},
"kind": "Agent",
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "repo.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!'",
"user_message_prefix": "The first character of your response should be 'I'"
},
"system_prompt_filename": "system_prompt.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
}
},
"workspace": {
"working_dir": "<string>",
"kind": "LocalWorkspace"
},
"persistence_dir": "workspace/conversations",
"max_iterations": 500,
"stuck_detection": true,
"execution_status": "idle",
"confirmation_policy": {
"kind": "AlwaysConfirm"
},
"security_analyzer": {
"kind": "LLMSecurityAnalyzer"
},
"activated_knowledge_skills": [
"<string>"
],
"stats": {
"usage_to_metrics": {}
},
"secret_registry": {
"secret_sources": {}
},
"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"
}Given an id, get a conversation
{
"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": 1,
"max_message_chars": 30000,
"temperature": 1,
"top_p": 1,
"top_k": 1,
"custom_llm_provider": "<string>",
"max_input_tokens": 2,
"max_output_tokens": 2,
"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",
"reasoning_summary": "auto",
"enable_encrypted_reasoning": false,
"prompt_cache_retention": "24h",
"extended_thinking_budget": 200000,
"seed": 123,
"safety_settings": [
{}
],
"usage_id": "default",
"litellm_extra_body": {},
"OVERRIDE_ON_SERIALIZE": [
"api_key",
"aws_access_key_id",
"aws_secret_access_key",
"litellm_extra_body"
]
},
"kind": "Agent",
"tools": [
{
"name": "<string>",
"params": {}
}
],
"mcp_config": {},
"filter_tools_regex": "^(?!repomix)(.*)|^repomix.*pack_codebase.*$",
"agent_context": {
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "repo.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!'",
"user_message_prefix": "The first character of your response should be 'I'"
},
"system_prompt_filename": "system_prompt.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
}
},
"workspace": {
"working_dir": "<string>",
"kind": "LocalWorkspace"
},
"persistence_dir": "workspace/conversations",
"max_iterations": 500,
"stuck_detection": true,
"execution_status": "idle",
"confirmation_policy": {
"kind": "AlwaysConfirm"
},
"security_analyzer": {
"kind": "LLMSecurityAnalyzer"
},
"activated_knowledge_skills": [
"<string>"
],
"stats": {
"usage_to_metrics": {}
},
"secret_registry": {
"secret_sources": {}
},
"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"
}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
LLM configuration for the agent.
Show child attributes
Model name.
API key.
Custom base URL.
API version (e.g., Azure).
x >= 0x >= 0x >= 0x >= 0HTTP timeout (s).
x >= 0Approx max chars in each event/content sent to the LLM.
x >= 1Sampling temperature for response generation. Defaults to 0 for most models and provider default for reasoning models.
x >= 00 <= x <= 1x >= 0The maximum number of input tokens. Note that this is currently unused, and the value at runtime is actually the total tokens in OpenAI (e.g. 128,000 tokens for GPT-4).
x >= 1The maximum number of output tokens. This is sent to the LLM.
x >= 1The cost per input token. This will available in logs for user.
x >= 0The cost per output token. This will available in logs for user.
x >= 0Enable streaming responses from the LLM. When enabled, the provided on_token callback in .completions and .responses will be invoked for each chunk of tokens.
Modify params allows litellm to do transformations like adding a default message, when a message is empty.
If model is vision capable, this option allows to disable image processing (useful for cost reduction).
Disable using of stop word.
Enable caching of prompts.
Enable logging of completions.
The folder to log LLM completions to. Required if log_completions is True.
A custom tokenizer to use for token counting.
Whether to use native tool calling.
Force using string content serializer when sending to LLM API. If None (default), auto-detect based on model. Useful for providers that do not support list content, like HuggingFace and Groq.
The effort to put into reasoning. This is a string that can be one of 'low', 'medium', 'high', or 'none'. Can apply to all reasoning models.
low, medium, high, none The level of detail for reasoning summaries. This is a string that can be one of 'auto', 'concise', or 'detailed'. Requires verified OpenAI organization. Only sent when explicitly set.
auto, concise, detailed If True, ask for ['reasoning.encrypted_content'] in Responses API include.
Retention policy for prompt cache. Only sent for GPT-5+ models; explicitly stripped for all other models.
The budget tokens for extended thinking, supported by Anthropic models.
The seed to use for random number generation.
Unique usage identifier for the LLM. Used for registry lookups, telemetry, and spend tracking.
Additional key-value pairs to pass to litellm's extra_body parameter. This is useful for custom inference endpoints that need additional parameters for configuration, routing, or advanced features. NOTE: Not all LLM providers support extra_body parameters. Some providers (e.g., OpenAI) may reject requests with unrecognized options. This is commonly supported by: - LiteLLM proxy servers (routing metadata, tracing) - vLLM endpoints (return_token_ids, etc.) - Custom inference clusters Examples: - Proxy routing: {'trace_version': '1.0.0', 'tags': ['agent:my-agent']} - vLLM features: {'return_token_ids': True}
"Agent"List of tools to initialize for the agent.
Optional MCP configuration dictionary to create MCP tools.
Optional regex to filter the tools available to the agent by name. This is applied after any tools provided in tools and any MCP tools are added.
"^(?!repomix)(.*)|^repomix.*pack_codebase.*$"
Optional AgentContext to initialize the agent with specific context.
Show child attributes
List of available skills that can extend the user's input.
Show child attributes
Skills use triggers to determine when they should be activated. None implies skill is always active. Other implementations include KeywordTrigger (activated by a keyword in a Message) and TaskTrigger (activated by specific tasks and may require user input)
The source path or identifier of the skill. When it is None, it is treated as a programmatically defined skill.
MCP tools configuration for the skill (repo skills only). It should conform to the MCPConfig schema: https://gofastmcp.com/clients/client#configuration-format
Optional suffix to append to the system prompt.
Optional suffix to append to the user's message.
Whether to automatically load user skills from ~/.openhands/skills/ and ~/.openhands/microagents/ (for backward compatibility).
Whether to automatically load skills from the public OpenHands skills repository at https://github.com/OpenHands/skills. This allows you to get the latest skills without SDK updates.
{
"skills": [
{
"content": "When you see this message, you should reply like you are a grumpy cat forced to use the internet.",
"name": "repo.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!'",
"user_message_prefix": "The first character of your response should be 'I'"
}System prompt template filename. Can be either:
Optional kwargs to pass to the system prompt Jinja2 template.
Optional condenser to use for condensing conversation history.
Show child attributes
Language model interface for OpenHands agents.
The LLM class provides a unified interface for interacting with various language models through the litellm library. It handles model configuration, API authentication, retry logic, and tool calling capabilities.
Example: >>> from openhands.sdk import LLM >>> from pydantic import SecretStr >>> llm = LLM( ... model="claude-sonnet-4-20250514", ... api_key=SecretStr("your-api-key"), ... usage_id="my-agent" ... ) >>> # Use with agent or conversation
Show child attributes
Model name.
API key.
Custom base URL.
API version (e.g., Azure).
x >= 0x >= 0x >= 0x >= 0HTTP timeout (s).
x >= 0Approx max chars in each event/content sent to the LLM.
x >= 1Sampling temperature for response generation. Defaults to 0 for most models and provider default for reasoning models.
x >= 00 <= x <= 1x >= 0The maximum number of input tokens. Note that this is currently unused, and the value at runtime is actually the total tokens in OpenAI (e.g. 128,000 tokens for GPT-4).
x >= 1The maximum number of output tokens. This is sent to the LLM.
x >= 1The cost per input token. This will available in logs for user.
x >= 0The cost per output token. This will available in logs for user.
x >= 0Enable streaming responses from the LLM. When enabled, the provided on_token callback in .completions and .responses will be invoked for each chunk of tokens.
Modify params allows litellm to do transformations like adding a default message, when a message is empty.
If model is vision capable, this option allows to disable image processing (useful for cost reduction).
Disable using of stop word.
Enable caching of prompts.
Enable logging of completions.
The folder to log LLM completions to. Required if log_completions is True.
A custom tokenizer to use for token counting.
Whether to use native tool calling.
Force using string content serializer when sending to LLM API. If None (default), auto-detect based on model. Useful for providers that do not support list content, like HuggingFace and Groq.
The effort to put into reasoning. This is a string that can be one of 'low', 'medium', 'high', or 'none'. Can apply to all reasoning models.
low, medium, high, none The level of detail for reasoning summaries. This is a string that can be one of 'auto', 'concise', or 'detailed'. Requires verified OpenAI organization. Only sent when explicitly set.
auto, concise, detailed If True, ask for ['reasoning.encrypted_content'] in Responses API include.
Retention policy for prompt cache. Only sent for GPT-5+ models; explicitly stripped for all other models.
The budget tokens for extended thinking, supported by Anthropic models.
The seed to use for random number generation.
Unique usage identifier for the LLM. Used for registry lookups, telemetry, and spend tracking.
Additional key-value pairs to pass to litellm's extra_body parameter. This is useful for custom inference endpoints that need additional parameters for configuration, routing, or advanced features. NOTE: Not all LLM providers support extra_body parameters. Some providers (e.g., OpenAI) may reject requests with unrecognized options. This is commonly supported by: - LiteLLM proxy servers (routing metadata, tracing) - vLLM endpoints (return_token_ids, etc.) - Custom inference clusters Examples: - Proxy routing: {'trace_version': '1.0.0', 'tags': ['agent:my-agent']} - vLLM features: {'return_token_ids': True}
"LLMSummarizingCondenser"x >= 0{
"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
}Local workspace implementation that operates on the host filesystem.
LocalWorkspace provides direct access to the local filesystem and command execution environment. It's suitable for development and testing scenarios where the agent should operate directly on the host system.
Example: >>> workspace = LocalWorkspace(working_dir="/path/to/project") >>> with workspace: ... result = workspace.execute_command("ls -la") ... content = workspace.read_file("README.md")
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 List of activated knowledge skills name
Conversation statistics for tracking LLM metrics
Show child attributes
Active usage metrics tracked by the registry.
Show child attributes
Metrics class can record various metrics during running and evaluation. We track:
Show child attributes
Name of the model
Total accumulated cost, must be non-negative
x >= 0Maximum budget per task
Accumulated token usage across all calls
Show child attributes
Prompt tokens must be non-negative
x >= 0Completion tokens must be non-negative
x >= 0Cache read tokens must be non-negative
x >= 0Cache write tokens must be non-negative
x >= 0Reasoning tokens must be non-negative
x >= 0Context window must be non-negative
x >= 0Per turn tokens must be non-negative
x >= 0List of response latencies
List of token usage records
Show child attributes
Prompt tokens must be non-negative
x >= 0Completion tokens must be non-negative
x >= 0Cache read tokens must be non-negative
x >= 0Cache write tokens must be non-negative
x >= 0Reasoning tokens must be non-negative
x >= 0Context window must be non-negative
x >= 0Per turn tokens must be non-negative
x >= 0Registry for handling secrets and sensitive data
Show child attributes
Show child attributes
A secret looked up from some external url
Show child attributes
"LookupSecret"Optional description for this secret
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
Name of the model
Total accumulated cost, must be non-negative
x >= 0Maximum budget per task
Accumulated token usage across all calls
Show child attributes
Prompt tokens must be non-negative
x >= 0Completion tokens must be non-negative
x >= 0Cache read tokens must be non-negative
x >= 0Cache write tokens must be non-negative
x >= 0Reasoning tokens must be non-negative
x >= 0Context window must be non-negative
x >= 0Per turn tokens must be non-negative
x >= 0Was this page helpful?