LLM API接口对比:Claude、Google与OpenAI协议详解

15 April 2026
IMG-THUMBNAIL
详细对比三种主流LLM API接口的特性与差异,包括Claude原生协议、Google Antigravity测试版和OpenAI兼容协议。文章分析了各接口的协议类型、适用场景、稳定性和生态兼容性,并从请求体结构、流式响应格式和错误处理等维度进行深入比较,提供了基于不同使用场景的接口选择指南。

npx skills——AI Agent 能力包管理器

npx skills = Vercel 开源 AI 代理技能管理器 CLI(Claude Code / Cursor / OpenCode 专用

一键安装 / 管理 AI 技能包(SKILL.md),自动放到 Claude/Cursor 对应目录(.claude/skills)。全局安装要在HOME目录下执行。

官方商店:The Agent Skills Directory

常用命令

npx skills add 仓库地址       # 安装技能
npx skills list               # 查看已装技能
npx skills init               # 新建自己的 SKILL.md
npx skills find react        # 查找 React 相关技能包
npx skills remove 作者/仓库名  # 删除技能包
npx skills update 作者/仓库名  # 更新技能包
npx skills path               # 查看技能包目录

核心结构

你的项目/
└── .skills/             # 所有技能都在这里
    ├── installed.json   # 已安装列表
    └── skills/          # 技能源码
  1. system prompt(AI 行为规则)
  2. tools(可执行命令 / API / 浏览器操作)
  3. knowledge(文档 / 规范 / 最佳实践)

Claude Code Skill / OpenCLaw Skill / Vercel Skill

有这么多工具都支持Skill,他们是一回事么?区别是什么?

维度 Claude Code Skills OpenClaw Skills
开发者 Anthropic OpenClaw 社区(开源)
核心文件 SKILL.md(YAML frontmatter + Markdown 正文) SKILL.md(YAML frontmatter + Markdown 正文)
文件格式 完全相同,均为 YAML frontmatter + Markdown 指令 同左,OpenClaw 官方称其为 AgentSkills,但格式一致
目录结构 .claude/skills//SKILL.md + scripts/ + references/ ~/.openclaw/skills//SKILL.md + scripts/ + references/
作用域 项目级 .claude/skills/ 或全局 ~/.claude/skills/ 项目级工作区 或 全局 ~/.openclaw/skills/
触发方式 Agent 自动匹配 description 或用户 /slash-command Agent 自动匹配 或 /slash-command
底层模型 仅限 Claude(Anthropic 闭源生态) 模型无关:Claude、GPT-4、Llama 3、Mistral 等均可
运行环境 Anthropic 云端 或 本地终端 完全自托管,代码在用户基础设施上运行
互相迁移 需补充 YAML frontmatter 中 name: description: 字段才能在 OpenClaw 识别
环境变量 通过系统环境变量读取 支持 openclaw.json 中的 skills.entries..env 配置
Vercel 兼容 支持,npx skills add 可安装 支持,同一个 Vercel Skill 包无需修改
安全模型 Anthropic 托管 + 权限沙箱 用户自行负责:需审计 Skill 内容防止 RCE、数据泄露
生态规模 官方内置 + 社区贡献 ClawHub 市场 860+ 技能 + 社区贡献

关键差异总结

  1. 格式层面几乎一致 — 都是 SKILL.md + YAML frontmatter + Markdown 指令 + scripts/references 辅助文件,迁移成本低
  2. 最大差异在模型绑定 — Claude Code 锁定 Anthropic 生态,OpenClaw 支持任意 LLM
  3. 安全模型不同 — Claude Code 有 Anthropic 官方沙箱保护;OpenClaw 需自行审计 Skill 安全性(已有案例:Cisco 安全团队发现第三方 Skill 存在数据泄露和 prompt 注入风险)
  4. 迁移注意 — Claude Code Skill 迁移到 OpenClaw 时,需确保 frontmatter 包含 name:description: 字段,否则 OpenClaw 无法加载

优秀案例

Skill除了官方商店,还可以自行实现,下面这个例子就非常经典可以深入学习。它做到了仅用一篇文档就能够实现带命令行的技能包,效果不亚于代码实现。

wiki-gen-skill.md

命令

/wiki ingest        # Convert your data into raw markdown entries
/wiki absorb all    # Compile entries into wiki articles
/wiki query 什么是agent  # Ask questions about the wiki 

提示词洞察

Hint

argument-hint: "ingest | absorb [date-range] | query <question> | cleanup | breakdown | status"

ingest

Write a Python script ingest.py to do this. This step is mechanical, no LLM intelligence needed.

让AI现场写脚本实现,禁止模型转换文档,非常有想象力,除了节省token,关键是手写脚本,一般我们都是自己先写好,非常大胆。

Process entries one at a time, chronologically. Read _index.md before each entry to match against existing articles. Re-read every article before updating it. This is non-negotiable.

语气比我写的更重——绝对不能商量

absorb

  • Anti-Cramming反灌输。禁止文件过大堆砌
  • Anti-Thinning 禁止创建无实质内容的空页面 / 薄页面
  • Every 15 Entries: Checkpoint 每 15 条做质量审计

定期检查,这里的检查策略跟之前提到过的harness很像——强力提示词:

  1. Quality audit: Pick your 3 most-updated articles. Re-read each as a whole piece. Ask:
    1. Does it tell a coherent story, or is it a chronological dump?
    2. Does it have sections organized by theme, not date?
    3. Does it use direct quotes to carry emotional weight?
    4. Does it connect to other articles in revealing ways?
    5. Would a reader learn something non-obvious? If any article reads like an event log, rewrite it.
  2. Check if any articles exceed 150 lines and should be split.

query

不要猜、不要阅读整个wiki、禁止修改

  • Never read raw diary entries (raw/entries/). The wiki is the knowledge base.
  • Don’t guess. If the wiki doesn’t cover it, say so.
  • Don’t read the entire wiki. Be surgical.
  • Don’t modify any wiki files. Query is read-only.

关系图谱可视化

生成的关系图谱可以用工具可视化:Obsidian。它会扫描当前目录所有md文件,所以打开目录时选择要注意下要选择生成的文件夹,选根目录内容会非常多。

原文链接: LLM API接口对比:Claude、Google与OpenAI协议详解 ,转载请注明来源!

EOF