> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lithosai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 在 OpenHands 中使用 LithosAI

> 通过 OpenHands 的 OpenAI 兼容 LLM 设置，直接接入 LithosAI。

## 开始之前

安装并启动 OpenHands，在 [API Key](https://console.lithosai.cloud/keys?lang=zh) 页面创建 key，并在 [模型](https://console.lithosai.cloud/models?lang=zh) 页面确认要用的模型 ID。

<Steps>
  <Step title="打开 LLM 设置">
    打开 OpenHands 网页界面。在初始设置对话框中选择 **See advanced settings**。如果已经完成设置，打开 **Settings**，选择 **LLM**，然后开启 **Advanced**。
  </Step>

  <Step title="配置 LithosAI">
    填写以下内容：

    | 字段 | 值 |
    | - | - |
    | Custom Model | `openai/moonshotai/Kimi-K3-fast` |
    | Base URL | `https://api.lithosai.cloud/v1` |
    | API Key | 你的 LithosAI API key |

    `moonshotai/Kimi-K3-fast` 只是示例，换成你选的模型或速度档位。

    `openai/` 前缀让 OpenHands 使用它的 OpenAI 兼容客户端，前缀后面的部分必须和 LithosAI 控制台中显示的模型 ID 一致。

    <Tip>
      OpenHands 的系统提示词和工具需要较大的上下文窗口。根据你的仓库和任务，选择上下文足够大的模型。
    </Tip>
  </Step>

  <Step title="保存并开始会话">
    点击 **Save Settings**，创建工作区，然后开始新对话。
  </Step>
</Steps>

## 问题排查

| 现象 | 原因 |
| - | - |
| OpenHands 找不到模型 | **Custom Model** 的值缺少 `openai/` 前缀，或者前缀后的模型 ID 不对。 |
| OpenHands 表现得像普通聊天机器人 | 所选模型可能无法稳定地进行工具调用。换一个更强的编程模型试试。 |
| Agent 过早丢失上下文 | 所选模型的上下文窗口太小，容纳不下 OpenHands 的提示词和工作区内容。 |

所有 Agent 通用的问题见[常见问题](/zh/agent-integrations#常见问题)。

## 参考资料

* [OpenHands OpenAI 兼容 LLM 配置](https://docs.openhands.dev/openhands/usage/llms/local-llms)
* [安装 OpenHands](https://docs.openhands.dev/openhands/usage/installation)
* [LithosAI 模型](https://console.lithosai.cloud/models?lang=zh)


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