分类: 代码 Agent 教程

Cline、Claude Code、Codex、Aider、Roo Code、Kilo Code 等代码 Agent 接入 DeepAI 教程。

Claude code deepai mcp empty params serialization.png

Claude Code 接入 DeepAI API 中转站:MCP 工具参数变成空对象 {} 的排查Claude Code 接入 DeepAI API 中转站:MCP 工具参数变成空对象 {} 的排查

Claude Code 使用 MCP 工具时,如果工具被调用但 MCP Server 收到的 arguments 变成 {},不要只排查 API 中转站。本文结合 anthropics/claude-code Issue #3966,讲清如何区分 DeepAI API 中转站请求、模型 tool use、Claude Code MCP 参数序列化和 MCP Server schema 四个层面。

Codex cli deepai openai base url ignored config.png

Codex CLI 接入 DeepAI API 中转站:openai_base_url 不生效仍访问 api.openai.com 的排查Codex CLI 接入 DeepAI API 中转站:openai_base_url 不生效仍访问 api.openai.com 的排查

Codex CLI 配置 DeepAI API 中转站或其他 OpenAI-compatible endpoint 后,仍然请求 api.openai.com,通常不是中转站失效,而是 openai_base_url、model_provider 或 model_providers 写错了配置层级。本文结合 openai/codex Issue #16719 与官方 config.toml 文档,整理可复现排查步骤。

Codex cli deepai responses api missing reasoning item.png

Codex CLI 接入 DeepAI API 中转站:Responses API 缺 reasoning item 导致第二轮 400Codex CLI 接入 DeepAI API 中转站:Responses API 缺 reasoning item 导致第二轮 400

Codex CLI 通过自定义 Responses API Provider 或 Azure/中转站调用 GPT-5 Codex 时,如果第一轮成功、第二轮报 message missing reasoning item,通常是 response item 与 reasoning item 没有被完整保存和回放。本文结合 openai/codex Issue #6375、#5990 与 PR #3528,整理 DeepAI API 中转站场景下的排查与修复方法。

Claude code deepai anthropic base url v1 messages.png

Claude Code 接入 DeepAI API 中转站:ANTHROPIC_BASE_URL 与 /v1/messages 怎么配置Claude Code 接入 DeepAI API 中转站:ANTHROPIC_BASE_URL 与 /v1/messages 怎么配置

Claude Code 支持通过 ANTHROPIC_BASE_URL 接入 LLM Gateway,但它需要 Anthropic API 格式的 /v1/messages,而不是普通 OpenAI-compatible /v1/chat/completions。本文结合 Claude Code Issue #216、官方 LLM Gateway 文档和 OAuth 覆盖问题,整理 DeepAI API 中转站场景下的接入与排查方法。

N8n deepai gpt5 unsupported stop parameter.png

n8n 接入 DeepAI API 中转站:GPT-5 unsupported STOP parameter 怎么修n8n 接入 DeepAI API 中转站:GPT-5 unsupported STOP parameter 怎么修

n8n 的 OpenAI Chat Model 节点接入 GPT-5 或 OpenAI-compatible Provider 时,如果报 unsupported STOP parameter,即使界面里没有手动设置 stop,也要检查旧 LangChain 依赖、旧 AI Agent 模板和请求体透传。本文结合 n8n Issue #18149 和 PR #18213,整理 DeepAI API 中转站场景下的排查与修复方法。

Openclaw deepai developer role 400 system role.png

OpenClaw 接入 DeepAI API 中转站:developer role 400 错误怎么修OpenClaw 接入 DeepAI API 中转站:developer role 400 错误怎么修

OpenClaw 通过 OpenAI-compatible Provider 接入 Qwen、DeepSeek、GLM、Kimi 或代理网关时,如果后端返回 developer is not one of system/user/assistant/tool/function,通常是 developer role 没有映射为 system。本文结合 OpenClaw Issue #27037 和 PR #29479,整理 DeepAI API 中转站场景下的排查与修复方法。

Openclaw deepai openai completions tools parameter.png

OpenClaw 接入 DeepAI API 中转站:openai-completions 不发送 tools 导致工具调用失效OpenClaw 接入 DeepAI API 中转站:openai-completions 不发送 tools 导致工具调用失效

OpenClaw 使用自定义 OpenAI-compatible Provider 时,如果请求里没有 tools 参数,模型可能只输出 JSON 文本而不会返回 tool_calls。本文结合 OpenClaw Issue #1866 / #8923,整理 DeepAI API 中转站场景下的复现、排查、升级和验证方法。

N8n deepai json mode internal error response format.png

n8n 接入 DeepAI API 中转站:JSON mode 报 Internal Error 怎么定位真实 400n8n 接入 DeepAI API 中转站:JSON mode 报 Internal Error 怎么定位真实 400

n8n OpenAI 节点使用 JSON mode / response_format=json_object 时,如果只显示 Internal Error,真实上游错误可能是 messages 或 instructions 没有包含 json 关键字。本文结合 n8n Issue #10206 和 1.56.0 修复,整理 DeepAI API 中转站场景下如何定位真实 400、补充 JSON 输出说明和 Schema 约束。

Openclaw deepai parallel tool calls 400 single tool call.png

OpenClaw 接入 DeepAI API 中转站:parallel_tool_calls 导致工具调用 400 怎么排查OpenClaw 接入 DeepAI API 中转站:parallel_tool_calls 导致工具调用 400 怎么排查

OpenClaw v2026.3.2 曾向所有 OpenAI-compatible Provider 强制发送 parallel_tool_calls:true,导致只支持单工具调用的模型返回 400 并让工具全部失效。本文结合 OpenClaw Issue #37048 和 PR #39356,整理 DeepAI API 中转站场景下如何识别、禁用和验证 parallel_tool_calls。

N8n deepai embeddings openai zero vector encoding format.png

n8n 接入 DeepAI API 中转站:Embeddings OpenAI 返回全 0 向量怎么修n8n 接入 DeepAI API 中转站:Embeddings OpenAI 返回全 0 向量怎么修

n8n Embeddings OpenAI 节点通过 OpenAI-compatible Embedding API 接入向量工作流时,如果返回全 0 向量,RAG 和 PGVector 检索会全部失效。本文结合 n8n Issue #16985 和 PR #20877,说明如何用 encodingFormat 参数修复 LM Studio 等兼容接口问题,并整理 DeepAI API 中转站场景下的排查方法。

Openclaw deepai memory lancedb custom embedding provider.png

OpenClaw 接入 DeepAI API 中转站:memory-lancedb 自定义 Embedding Provider 怎么配置OpenClaw 接入 DeepAI API 中转站:memory-lancedb 自定义 Embedding Provider 怎么配置

OpenClaw memory-lancedb 插件过去只支持官方 OpenAI embedding 模型,不能配置 baseUrl、自定义模型名和 dimensions。本文结合 OpenClaw Issue #8118 与已合并修复 #17874,整理通过 DeepAI API 中转站接入 OpenAI-compatible Embedding Provider 的配置、排查和上线验证方法。

Cline deepai tool use xml context error.png

Cline 接入 DeepAI API 中转站:You did not use a tool 工具调用错误怎么排查Cline 接入 DeepAI API 中转站:You did not use a tool 工具调用错误怎么排查

Cline / Roo Code 类代码 Agent 通过 OpenAI-compatible Provider 接入中转站时,如果提示 You did not use a tool in your previous response,常见根因不是 Base URL,而是模型没有按 XML 工具格式输出、项目上下文过大或本地模型 context 太小。本文结合 Cline Issue #735,整理 DeepAI