> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /openapi/agent-sdk.json post /api/sub-agents
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/sub-agents:
    post:
      tags:
        - Sub Agents
      summary: Get Sub Agents
      description: >-
        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.
      operationId: get_sub_agents_api_sub_agents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubAgentsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAgentsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    SubAgentsRequest:
      description: Request body for listing sub-agents.
      properties:
        load_builtin:
          default: true
          description: Load SDK built-in agents (general-purpose, code-explorer, ...)
          title: Load Builtin
          type: boolean
        load_project:
          default: true
          description: Load project agents from the workspace
          title: Load Project
          type: boolean
        load_user:
          default: true
          description: Load user agents from ~/.agents/agents and ~/.openhands/agents
          title: Load User
          type: boolean
        project_dir:
          anyOf:
            - type: string
            - type: 'null'
          description: Workspace directory path for project agents
          title: Project Dir
      title: SubAgentsRequest
      type: object
    SubAgentsResponse:
      description: Response containing all available sub-agents.
      properties:
        agents:
          items:
            $ref: '#/components/schemas/SubAgentInfo'
          title: Agents
          type: array
      required:
        - agents
      title: SubAgentsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SubAgentInfo:
      description: >-
        Lossless view of an ``AgentDefinition`` returned by the API.


        Every frontmatter field plus the discovered ``level``/``source``, an

        ``is_builtin`` flag, and the inline ``system_prompt`` (Markdown body) so
        a

        detail view needs no extra fetch.
      properties:
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        condenser:
          anyOf:
            - $ref: '#/components/schemas/CondenserBase-Output'
            - type: 'null'
        description:
          default: ''
          title: Description
          type: string
        hooks:
          anyOf:
            - $ref: '#/components/schemas/HookConfig'
            - type: 'null'
        is_builtin:
          default: false
          title: Is Builtin
          type: boolean
        level:
          anyOf:
            - enum:
                - project
                - user
                - builtin
                - plugin
                - programmatic
              type: string
            - type: 'null'
          title: Level
        max_budget_per_run:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Budget Per Run
        max_iteration_per_run:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Iteration Per Run
        mcp_config:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/MCPServer-Output'
              type: object
            - type: 'null'
          title: Mcp Config
        mcp_servers:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/MCPServer-Output'
              type: object
            - type: 'null'
          deprecated: true
          description: >-
            Deprecated compatibility alias for mcp_config. Use mcp_config for
            new clients.
          title: Mcp Servers
        metadata:
          additionalProperties: true
          title: Metadata
          type: object
        model:
          default: inherit
          title: Model
          type: string
        name:
          title: Name
          type: string
        permission_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Permission Mode
        profile_store_dir:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Store Dir
        skills:
          items:
            type: string
          title: Skills
          type: array
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        system_prompt:
          default: ''
          title: System Prompt
          type: string
        tools:
          items:
            type: string
          title: Tools
          type: array
        when_to_use_examples:
          items:
            type: string
          title: When To Use Examples
          type: array
      required:
        - name
      title: SubAgentInfo
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    CondenserBase-Output:
      discriminator:
        mapping:
          openhands__sdk__context__condenser__llm_summarizing_condenser__LLMSummarizingCondenser-Output__1: '#/components/schemas/LLMSummarizingCondenser-Output'
          openhands__sdk__context__condenser__no_op_condenser__NoOpCondenser-Output__1: '#/components/schemas/NoOpCondenser-Output'
          openhands__sdk__context__condenser__pipeline_condenser__PipelineCondenser-Output__1: '#/components/schemas/PipelineCondenser-Output'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/LLMSummarizingCondenser-Output'
        - $ref: '#/components/schemas/NoOpCondenser-Output'
        - $ref: '#/components/schemas/PipelineCondenser-Output'
    HookConfig:
      additionalProperties: false
      description: >-
        Configuration for all hooks.


        Hooks can be configured either by loading from `.openhands/hooks.json`
        or

        by directly instantiating with typed fields:

            # Direct instantiation with typed fields (recommended):
            config = HookConfig(
                pre_tool_use=[
                    HookMatcher(
                        matcher="terminal",
                        hooks=[HookDefinition(command="block_dangerous.sh")]
                    )
                ]
            )

            # Load from JSON file:
            config = HookConfig.load(".openhands/hooks.json")
      properties:
        post_tool_use:
          description: Hooks that run after tool execution
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: Post Tool Use
          type: array
        pre_tool_use:
          description: Hooks that run before tool execution
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: Pre Tool Use
          type: array
        session_end:
          description: Hooks that run when a session ends
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: Session End
          type: array
        session_start:
          description: Hooks that run when a session starts
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: Session Start
          type: array
        stop:
          description: Hooks that run when the agent attempts to stop
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: Stop
          type: array
        user_prompt_submit:
          description: Hooks that run when user submits a prompt
          items:
            $ref: '#/components/schemas/HookMatcher'
          title: User Prompt Submit
          type: array
      title: HookConfig
      type: object
    MCPServer-Output:
      additionalProperties: false
      description: One MCP server in the settings DataModel.
      properties:
        args:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Args
        auth:
          anyOf:
            - discriminator:
                mapping:
                  api_key: '#/components/schemas/MCPApiKeyAuthCredential-Output'
                  basic: '#/components/schemas/MCPBasicAuthCredential-Output'
                  bearer: '#/components/schemas/MCPBearerAuthCredential-Output'
                  header: '#/components/schemas/MCPHeaderAuthCredential-Output'
                  none: '#/components/schemas/MCPNoneAuthCredential'
                  oauth2: '#/components/schemas/MCPOAuthAuthCredential-Output'
                propertyName: strategy
              oneOf:
                - $ref: '#/components/schemas/MCPNoneAuthCredential'
                - $ref: '#/components/schemas/MCPApiKeyAuthCredential-Output'
                - $ref: '#/components/schemas/MCPBearerAuthCredential-Output'
                - $ref: '#/components/schemas/MCPBasicAuthCredential-Output'
                - $ref: '#/components/schemas/MCPHeaderAuthCredential-Output'
                - $ref: '#/components/schemas/MCPOAuthAuthCredential-Output'
            - type: 'null'
          title: Auth
        command:
          anyOf:
            - minLength: 1
              type: string
            - type: 'null'
          title: Command
        cwd:
          anyOf:
            - type: string
            - type: 'null'
          title: Cwd
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        enabled:
          default: true
          description: >-
            Whether this server is exposed to the agent. A disabled server stays
            fully configured -- including its secrets -- but is skipped when MCP
            tools are created and when servers are forwarded to an ACP
            subprocess.
          title: Enabled
          type: boolean
        env:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Env
        headers:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Headers
        icon:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon
        keep_alive:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Keep Alive
        sse_read_timeout:
          anyOf:
            - type: number
            - type: 'null'
          title: Sse Read Timeout
        timeout:
          anyOf:
            - type: number
            - type: 'null'
          title: Timeout
        transport:
          anyOf:
            - enum:
                - stdio
                - http
                - sse
                - streamable-http
              type: string
            - type: 'null'
          title: Transport
        url:
          anyOf:
            - minLength: 1
              type: string
            - type: 'null'
          title: Url
      title: MCPServer
      type: object
    LLMSummarizingCondenser-Output:
      description: >-
        LLM-based condenser that summarizes forgotten events.


        Uses an independent LLM (stored in the `llm` attribute) for generating
        summaries

        of forgotten events. The optional `agent_llm` parameter passed to
        condense() is

        the LLM used by the agent for token counting purposes, and you should
        not assume

        it is the same as the one defined in this condenser.
      properties:
        hard_context_reset_context_scaling:
          default: 0.8
          exclusiveMaximum: 1
          exclusiveMinimum: 0
          title: Hard Context Reset Context Scaling
          type: number
        hard_context_reset_max_retries:
          default: 5
          exclusiveMinimum: 0
          title: Hard Context Reset Max Retries
          type: integer
        keep_first:
          default: 2
          minimum: 0
          title: Keep First
          type: integer
        kind:
          const: LLMSummarizingCondenser
          title: Kind
          type: string
        llm:
          $ref: '#/components/schemas/LLM-Output'
        max_size:
          default: 240
          exclusiveMinimum: 0
          title: Max Size
          type: integer
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tokens
        minimum_progress:
          default: 0.1
          exclusiveMaximum: 1
          exclusiveMinimum: 0
          title: Minimum Progress
          type: number
      required:
        - llm
        - kind
      title: LLMSummarizingCondenser
      type: object
    NoOpCondenser-Output:
      description: |-
        Simple condenser that returns a view un-manipulated.

        Primarily intended for testing purposes.
      properties:
        kind:
          const: NoOpCondenser
          title: Kind
          type: string
      required:
        - kind
      title: NoOpCondenser
      type: object
    PipelineCondenser-Output:
      description: >-
        A condenser that applies a sequence of condensers in order.


        All condensers are defined primarily by their `condense` method, which
        takes a

        `View` and an optional `agent_llm` parameter, returning either a new
        `View` or a

        `Condensation` event. That means we can chain multiple condensers
        together by

        passing `View`s along and exiting early if any condenser returns a
        `Condensation`.


        For example:

            # Use the pipeline condenser to chain multiple other condensers together
            condenser = PipelineCondenser(condensers=[
                CondenserA(...),
                CondenserB(...),
                CondenserC(...),
            ])

            result = condenser.condense(view, agent_llm=agent_llm)

            # Doing the same thing without the pipeline condenser requires more boilerplate
            # for the monadic chaining
            other_result = view

            if isinstance(other_result, View):
                other_result = CondenserA(...).condense(other_result, agent_llm=agent_llm)

            if isinstance(other_result, View):
                other_result = CondenserB(...).condense(other_result, agent_llm=agent_llm)

            if isinstance(other_result, View):
                other_result = CondenserC(...).condense(other_result, agent_llm=agent_llm)

            assert result == other_result
      properties:
        condensers:
          items:
            $ref: '#/components/schemas/CondenserBase-Output'
          title: Condensers
          type: array
        kind:
          const: PipelineCondenser
          title: Kind
          type: string
      required:
        - condensers
        - kind
      title: PipelineCondenser
      type: object
    HookMatcher:
      description: >-
        Matches events to hooks based on patterns.


        Supports exact match, wildcard (*), and regex (auto-detected or
        /pattern/).
      properties:
        hooks:
          items:
            $ref: '#/components/schemas/HookDefinition'
          title: Hooks
          type: array
        matcher:
          default: '*'
          title: Matcher
          type: string
      title: HookMatcher
      type: object
    MCPApiKeyAuthCredential-Output:
      properties:
        header_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Header Name
        strategy:
          const: api_key
          title: Strategy
          type: string
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
      required:
        - strategy
      title: MCPApiKeyAuthCredential
      type: object
    MCPBasicAuthCredential-Output:
      properties:
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
        strategy:
          const: basic
          title: Strategy
          type: string
        username:
          title: Username
          type: string
      required:
        - strategy
        - username
      title: MCPBasicAuthCredential
      type: object
    MCPBearerAuthCredential-Output:
      properties:
        strategy:
          const: bearer
          title: Strategy
          type: string
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
      required:
        - strategy
      title: MCPBearerAuthCredential
      type: object
    MCPHeaderAuthCredential-Output:
      properties:
        headers:
          additionalProperties:
            anyOf:
              - type: string
              - type: 'null'
          title: Headers
          type: object
        strategy:
          const: header
          title: Strategy
          type: string
      required:
        - strategy
      title: MCPHeaderAuthCredential
      type: object
    MCPNoneAuthCredential:
      properties:
        strategy:
          const: none
          title: Strategy
          type: string
      required:
        - strategy
      title: MCPNoneAuthCredential
      type: object
    MCPOAuthAuthCredential-Output:
      properties:
        authentication:
          anyOf:
            - $ref: '#/components/schemas/MCPOAuthAuthentication-Output'
            - type: 'null'
        state:
          anyOf:
            - $ref: '#/components/schemas/MCPOAuthState-Output'
            - type: 'null'
        strategy:
          const: oauth2
          title: Strategy
          type: string
      required:
        - strategy
      title: MCPOAuthAuthCredential
      type: object
    LLM-Output:
      description: >-
        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.


        Attributes:
            model: Model name (e.g., "gpt-5.6").
            api_key: API key for authentication.
            base_url: Custom API base URL.
            num_retries: Number of retry attempts for failed requests.
            timeout: Request timeout in seconds.

        Example:
            ```python
            from openhands.sdk import LLM
            from pydantic import SecretStr

            llm = LLM(
                model="gpt-5.6",
                api_key=SecretStr("your-api-key"),
                usage_id="my-agent"
            )
            # Use with agent or conversation
            ```
      properties:
        api_key:
          anyOf:
            - type: string
            - format: password
              type: string
              writeOnly: true
            - type: 'null'
          description: API key.
          openhands_settings:
            depends_on: []
            label: API Key
            prominence: critical
          title: Api Key
        api_mode:
          default: auto
          description: >-
            LLM API endpoint mode. 'auto' resolves from model metadata and SDK
            fallbacks; use 'chat' or 'responses' to override endpoint selection
            for proxy aliases and newly released models.
          enum:
            - auto
            - chat
            - responses
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Api Mode
          type: string
        api_version:
          anyOf:
            - type: string
            - type: 'null'
          description: API version (e.g., Azure).
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Api Version
        auth_type:
          default: api_key
          description: Authentication mode for the LLM.
          enum:
            - api_key
            - subscription
          openhands_settings:
            depends_on: []
            label: Authentication
            prominence: critical
          title: Auth Type
          type: string
        aws_access_key_id:
          anyOf:
            - type: string
            - format: password
              type: string
              writeOnly: true
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Access Key Id
        aws_bedrock_runtime_endpoint:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Bedrock Runtime Endpoint
        aws_profile_name:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Profile Name
        aws_region_name:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Region Name
        aws_role_name:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Role Name
        aws_secret_access_key:
          anyOf:
            - type: string
            - format: password
              type: string
              writeOnly: true
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Secret Access Key
        aws_session_name:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Session Name
        aws_session_token:
          anyOf:
            - type: string
            - format: password
              type: string
              writeOnly: true
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Aws Session Token
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          description: Custom base URL.
          openhands_settings:
            depends_on: []
            prominence: major
          title: Base Url
        caching_prompt:
          default: true
          description: Enable caching of prompts.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Caching Prompt
          type: boolean
        capability_overrides:
          additionalProperties:
            anyOf:
              - type: boolean
              - type: string
          description: >-
            Explicit model capability overrides. Supported keys include
            supports_reasoning_effort, thinking_mode (adaptive, manual, none, or
            unknown), supports_sampling_params, supports_prompt_cache,
            supports_stop_words, supports_responses_api, supports_vision, and
            supports_prompt_cache_retention. Overrides take precedence over
            LiteLLM metadata and SDK fallbacks.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Capability Overrides
          type: object
        custom_tokenizer:
          anyOf:
            - type: string
            - type: 'null'
          description: A custom tokenizer to use for token counting.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Custom Tokenizer
        disable_stop_word:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          description: Disable using of stop word.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Disable Stop Word
        disable_vision:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            If model is vision capable, this option allows to disable image
            processing (useful for cost reduction).
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Disable Vision
        drop_params:
          default: true
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Drop Params
          type: boolean
        enable_encrypted_reasoning:
          default: true
          description: >-
            If True, ask for ['reasoning.encrypted_content'] in Responses API
            include.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Enable Encrypted Reasoning
          type: boolean
        extended_thinking_budget:
          anyOf:
            - type: integer
            - type: 'null'
          default: 200000
          description: >-
            Legacy token budget for models confirmed to use manual Anthropic
            extended thinking. Ignored for adaptive-thinking models. Prefer
            reasoning_effort for new integrations.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Extended Thinking Budget
        extra_headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          description: Optional HTTP headers to forward to LiteLLM requests.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Extra Headers
        force_string_serializer:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            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.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Force String Serializer
        inline_image_urls:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            If True, fetch any http(s) image URL in outgoing messages and inline
            it as a base64 ``data:`` URL before sending. If None (default),
            auto-detect based on model (some APIs such as Moonshot's public Kimi
            endpoint reject URL-formatted images and require base64). Set this
            explicitly when the model is reached through a proxy alias that
            hides the underlying provider (e.g.
            ``litellm_proxy/<custom-alias>``). Note: inlining only runs when
            ``vision_is_active()`` is True, so the alias must still be
            recognised as vision-capable by the SDK feature registry or proxy
            model metadata.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Inline Image Urls
        input_cost_per_token:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          description: The cost per input token. This will available in logs for user.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Input Cost Per Token
        is_subscription:
          description: >-
            Whether this LLM uses subscription-based authentication. Serialized
            so that subscription-specific request handling survives transport to
            a remote agent-server.
          readOnly: true
          title: Is Subscription
          type: boolean
        litellm_extra_body:
          additionalProperties: true
          description: >-
            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}
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Litellm Extra Body
          type: object
        log_completions:
          default: false
          description: Enable logging of completions.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Log Completions
          type: boolean
        log_completions_folder:
          default: logs/completions
          description: >-
            The folder to log LLM completions to. Required if log_completions is
            True.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Log Completions Folder
          type: string
        max_input_tokens:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: >-
            The 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).
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Max Input Tokens
        max_message_chars:
          default: 30000
          description: Approx max chars in each event/content sent to the LLM.
          minimum: 1
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Max Message Chars
          type: integer
        max_output_tokens:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: The maximum number of output tokens. This is sent to the LLM.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Max Output Tokens
        model:
          default: gpt-5.6
          description: Model name.
          openhands_settings:
            depends_on: []
            prominence: critical
          title: Model
          type: string
        model_canonical_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Optional canonical model name for feature registry lookups. The
            OpenHands SDK maintains a model feature registry that maps model
            names to capabilities (e.g., vision support, prompt caching,
            responses API support). When using proxied or aliased model
            identifiers, set this field to the canonical model name (e.g.,
            'openai/gpt-4o') to ensure correct capability detection. If not
            provided, the 'model' field will be used for capability lookups.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Model Canonical Name
        native_tool_calling:
          default: true
          description: Whether to use native tool calling.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Native Tool Calling
          type: boolean
        num_retries:
          default: 5
          minimum: 0
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Num Retries
          type: integer
        ollama_base_url:
          anyOf:
            - type: string
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Ollama Base Url
        openrouter_app_name:
          default: OpenHands
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Openrouter App Name
          type: string
        openrouter_site_url:
          default: https://docs.all-hands.dev/
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Openrouter Site Url
          type: string
        output_cost_per_token:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          description: The cost per output token. This will available in logs for user.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Output Cost Per Token
        prompt_cache_retention:
          anyOf:
            - type: string
            - type: 'null'
          default: 24h
          description: >-
            Retention policy for prompt cache. Only sent for supported models
            (GPT-5+ and GPT-4.1, excluding Azure deployments); explicitly
            stripped for all others.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Prompt Cache Retention
        provider_connection_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Optional provider connection whose shared API key and base URL are
            resolved and applied each time this LLM profile is loaded
            (read-at-use). When set, the profile stores no inline api_key or
            base_url of its own.
          openhands_settings:
            depends_on: []
            prominence: major
          title: Provider Connection Id
        reasoning_effort:
          anyOf:
            - enum:
                - low
                - medium
                - high
                - xhigh
                - none
              type: string
            - type: 'null'
          default: high
          description: >-
            Provider-neutral reasoning effort. Common values include 'none',
            'minimal', 'low', 'medium', 'high', 'xhigh', and 'max'. The SDK
            accepts future provider values and lets LiteLLM translate them.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Reasoning Effort
        reasoning_summary:
          anyOf:
            - enum:
                - auto
                - concise
                - detailed
              type: string
            - type: 'null'
          description: >-
            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.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Reasoning Summary
        retry_max_wait:
          default: 64
          minimum: 0
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Retry Max Wait
          type: integer
        retry_min_wait:
          default: 8
          minimum: 0
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Retry Min Wait
          type: integer
        retry_multiplier:
          default: 8
          minimum: 0
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Retry Multiplier
          type: number
        seed:
          anyOf:
            - type: integer
            - type: 'null'
          description: The seed to use for random number generation.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Seed
        stream:
          default: false
          description: >-
            Enable streaming responses from the LLM. When enabled, the provided
            `on_token` callback in .completions and .responses will be invoked
            for each chunk of tokens.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Stream
          type: boolean
        stream_idle_timeout:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          default: 300
          description: >-
            Maximum seconds between chunks in an asynchronous streaming
            response. Default is 300s (5 minutes); set to None to disable.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Stream Idle Timeout
        subscription_vendor:
          anyOf:
            - const: openai
              type: string
            - type: 'null'
          description: Subscription provider for subscription-backed LLM access.
          openhands_settings:
            depends_on:
              - auth_type
            label: Subscription provider
            prominence: critical
          title: Subscription Vendor
        temperature:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          description: >-
            Sampling temperature for response generation. Defaults to None (uses
            provider default temperature). Set to 0.0 for deterministic outputs,
            or higher values (0.7-1.0) for more creative responses.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Temperature
        timeout:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          default: 300
          description: >-
            HTTP and hard per-attempt timeout in seconds. Default is 300s (5
            minutes). Set to None to disable the hard timeout.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Timeout
        top_k:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Top K
        top_p:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          description: >-
            Nucleus sampling parameter. Defaults to None (uses provider
            default). Set to a value between 0 and 1 to control diversity of
            outputs.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Top P
        usage_id:
          default: default
          description: >-
            Unique usage identifier for the LLM. Used for registry lookups,
            telemetry, and spend tracking.
          openhands_settings:
            depends_on: []
            prominence: minor
          title: Usage Id
          type: string
      required:
        - is_subscription
      title: LLM
      type: object
    HookDefinition:
      description: A single hook definition.
      properties:
        async:
          default: false
          title: Async
          type: boolean
        command:
          title: Command
          type: string
        max_iterations:
          default: 3
          title: Max Iterations
          type: integer
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
        timeout:
          default: 60
          title: Timeout
          type: integer
        tools:
          items:
            type: string
          title: Tools
          type: array
        type:
          $ref: '#/components/schemas/HookType'
          default: command
      required:
        - command
      title: HookDefinition
      type: object
    MCPOAuthAuthentication-Output:
      additionalProperties: false
      properties:
        additional_client_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Additional Client Metadata
        client_auth_method:
          anyOf:
            - enum:
                - none
                - client_secret_post
                - client_secret_basic
                - private_key_jwt
              type: string
            - type: 'null'
          title: Client Auth Method
        client_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Id
        client_metadata_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Metadata Url
        client_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Name
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
        scopes:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
        type:
          const: oauth
          title: Type
          type: string
      required:
        - type
      title: MCPOAuthAuthentication
      type: object
    MCPOAuthState-Output:
      properties:
        client_info:
          anyOf:
            - $ref: '#/components/schemas/MCPOAuthClientInfoState-Output'
            - type: 'null'
        token_expires_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Token Expires At
        tokens:
          anyOf:
            - $ref: '#/components/schemas/MCPOAuthTokenState-Output'
            - type: 'null'
      title: MCPOAuthState
      type: object
    HookType:
      description: Types of hooks that can be executed.
      enum:
        - command
        - prompt
        - agent
      title: HookType
      type: string
    MCPOAuthClientInfoState-Output:
      additionalProperties: true
      properties:
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
      title: MCPOAuthClientInfoState
      type: object
    MCPOAuthTokenState-Output:
      additionalProperties: true
      properties:
        access_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Token
        refresh_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Refresh Token
      title: MCPOAuthTokenState
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.