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

# Agent 接入

> 把常用的编程 Agent 接入 LithosAI。

LithosAI 提供 OpenAI Chat Completions API。支持这一协议的 Agent 可以直连；Codex 和 Claude Code 需要通过本地兼容适配层接入。在下表中选择你的 Agent，查看配置步骤。

| Agent | 客户端协议 | 接入方式 |
| - | - | - |
| [Cline](/zh/agent-integrations/cline) | Chat Completions | 直连 |
| [Hermes Agent](/zh/agent-integrations/hermes-agent) | Chat Completions | 直连 |
| [Codex](/zh/agent-integrations/codex) | Responses API | LiteLLM 兼容适配层 |
| [Kilo Code](/zh/agent-integrations/kilo-code) | Chat Completions | 直连 |
| [Claude Code](/zh/agent-integrations/claude-code) | Anthropic Messages API | LiteLLM 兼容适配层 |
| [omp](/zh/agent-integrations/omp) | Chat Completions | 直连 |
| [OpenClaw](/zh/agent-integrations/openclaw) | Chat Completions | 直连 |
| [OpenCode](/zh/agent-integrations/opencode) | Chat Completions | 直连 |
| [OpenHands](/zh/agent-integrations/openhands) | Chat Completions | 直连 |
| [Pi](/zh/agent-integrations/pi) | Chat Completions | 直连 |

## 选择模型和推理强度

在 [模型](https://console.lithosai.cloud/models?lang=zh) 页面找到准确的模型 ID。不同速度档位的模型 ID 不同，例如 `moonshotai/Kimi-K3-fast` 或 `moonshotai/Kimi-K3-ultra`。使用其他模型时，填写完整 ID，例如 `deepseek-ai/DeepSeek-V4.1-Flash-fast`。推理强度是单独的设置项。

| CLI | 选择模型 | 调整推理强度 |
| - | - | - |
| OpenCode | `/models` | `/variants` |
| Pi | `/model` | `/settings` |
| Hermes | `/model` | `/reasoning` |
| Kilo CLI | `/models` | `/variants` |
| Cline CLI | `/model` | 启动或恢复会话时加 `--thinking low` 或 `--thinking high` |
| omp | `/switch` | Shift+Tab |
| OpenClaw 本地 TUI | `/models` | `/think` |

每篇指南都包含 provider 配置，以及模型和推理强度的设置方法。

## 开始之前

先安装要用的 Agent，在 [API Key](https://console.lithosai.cloud/keys?lang=zh) 页面创建 key，并在 [模型](https://console.lithosai.cloud/models?lang=zh) 页面确认模型 ID。然后按对应 Agent 的指南，把 key 保存到它的设置、密钥文件或运行环境中。你现有的编辑器、CLI 或 Gateway 都可以照常使用。

<Note>
  LithosAI 会严格校验工具 schema。如果 Agent 加载的某个 MCP server 的工具参数不是 JSON Schema 对象，请求会被拒绝，并返回 `invalid 'parameters' schema`。请禁用这个 server，或修正它的 schema。
</Note>

## 常见问题

以下内容适用于所有 Agent 指南。

### 限制

* 最小配置只启用文本和工具调用。图片输入、推理或其他能力开关，只有在所选 LithosAI 模型支持时才打开。
* 上下文窗口和最大输出长度按所选模型在 [模型](https://console.lithosai.cloud/models?lang=zh) 页面上的值来设置。配置示例里的 token 预算只是示意，请换成该页面上的实际限制。
* 推理 token 和最终回答共用输出预算。选择 `max` 推理强度不会增加这个预算。如果响应以 `finish_reason: length` 结束，请在模型限制范围内调大输出预算，并给输入留出空间。
* LithosAI API key 只保存在 Agent 自己的设置或环境变量里，不要提交到项目仓库。

### 问题排查

| 现象 | 原因 |
| - | - |
| 认证失败 | LithosAI API key 缺失、已过期，或者运行 Agent 的进程读不到它。 |
| 找不到模型或无法选择模型 | 模型 ID 与 [模型](https://console.lithosai.cloud/models?lang=zh) 页面上的值不完全一致。 |
| 上下文用量显示或压缩时机不准 | 按模型页面上的值更新上下文窗口和输出上限。 |
| 请求返回 `404` | base URL 必须是 `https://api.lithosai.cloud/v1`，除非 Agent 页面另有说明。 |


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