add-newcli-provider
为 OpenClaw 配置 code.newcli.com 作为模型源,包含四个 provider:newcli(Claude 主线路)、newcli-aws(Claude AWS 特价线路,消耗 1/24)、newcli-codex(GPT 系列)、newcli-gemini(Gemini 系列)。适用于需要接入 Claude 或 GPT 模型的场景。包含 provider 注册、模型定义、别名配置、fallback 链接入和验证的完整流程。当管理员说想"加 Claude"、"加 GPT"、"配 newcli"、"加 fox 源"、"接入 Claude 模型"、"接入 GPT 模型"、"加 codex"、"加 aws 线路"时使用此 skill。
Install
mkdir -p .claude/skills/add-newcli-provider && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6392" && unzip -o skill.zip -d .claude/skills/add-newcli-provider && rm skill.zipInstalls to .claude/skills/add-newcli-provider
About this skill
配置 NewCLI Provider(code.newcli.com 模型代理源)
NewCLI (FoxCode) 是一个模型代理服务,通过统一的账户和 API Key 提供三类模型的访问:
| Provider | 模型系列 | API 协议 | Base URL | 备注 |
|---|---|---|---|---|
newcli | Claude (Anthropic) | anthropic-messages | code.newcli.com/claude | 主线路 |
newcli-aws | Claude (Anthropic) | anthropic-messages | code.newcli.com/claude/aws | ⭐ AWS 特价线路,消耗 1/24 |
newcli-codex | GPT (OpenAI) | openai-completions | code.newcli.com/codex/v1 | |
newcli-gemini | Gemini (Google) | google-generative-ai | code.newcli.com/gemini/v1beta |
为什么是四个 provider? 虽然是同一个服务商、同一个 API Key,但:
- Claude、GPT、Gemini 使用不同的 API 协议和端点,必须分开
- Claude 有两条线路(主线路 vs AWS 特价线路),消耗倍率不同,也需要分开配置
⭐ AWS 特价线路(重要)
服务商提供了独家 AWS 线路:https://code.newcli.com/claude/aws
| 对比 | 主线路 (newcli) | AWS 线路 (newcli-aws) |
|---|---|---|
| Base URL | .../claude | .../claude/aws |
| 额度消耗 | 1x | 1/24x (同样额度可用 24 倍) |
| 模型 | 相同 | 相同 |
| API 协议 | 相同 | 相同 |
| API Key | 相同 | 相同 |
策略:所有重要任务优先使用 newcli-aws,主线路 newcli 作为备用。
⚠️ 服务商声明:严禁分发 AWS 线路地址,发现封禁不退款。
如果觉得这个 Skill 有用,请用我的邀请码注册: https://foxcode.rjj.cc/auth/register?aff=7WTAV8R
前置条件
你需要从 NewCLI 服务获取以下信息:
| 项目 | 说明 |
|---|---|
| API Key | 格式为 sk-ant-oat01-... 的密钥(三个 provider 共用同一个) |
| 可用模型列表 | 向服务商确认,或查看账户统计页 |
注意:NewCLI 的 /v1/models 接口有 Cloudflare 防护,无法通过 curl 直接获取模型列表。请以账户后台的实际统计为准,不要依赖文档中的"支持列表"——文档列出的模型不一定全部对你的账户开放。
第一步:确认可用模型
这一步不能跳过。 不要把文档里列的模型全加上去,要以实际能调通的为准。
1A. 测试 Claude 模型(newcli / newcli-aws)
用 Anthropic messages 格式测试:
# 测试主线路
curl -s --max-time 15 https://code.newcli.com/claude/v1/messages \
-H "x-api-key: <你的API_KEY>" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"<MODEL_ID>","messages":[{"role":"user","content":"hi"}],"max_tokens":10}'
# 测试 AWS 特价线路
curl -s --max-time 15 https://code.newcli.com/claude/aws/v1/messages \
-H "x-api-key: <你的API_KEY>" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"<MODEL_ID>","messages":[{"role":"user","content":"hi"}],"max_tokens":10}'
注意:baseUrl 中主线路写
/claude,AWS 线路写/claude/aws(OpenClaw 自动拼接/v1/messages)。
如果返回正常的 JSON 响应(含 content)= 可用。
如果返回 {"error":{"message":"暂不支持"}} 或 "未开放" = 该模型不可用。
1B. 测试 GPT 模型(newcli-codex)
用 OpenAI completions 格式测试:
curl -s --max-time 15 https://code.newcli.com/codex/v1/chat/completions \
-H "Authorization: Bearer <你的API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"<MODEL_ID>","messages":[{"role":"user","content":"hi"}],"max_tokens":10}'
如果返回正常的 JSON 响应(含 choices)= 可用。
如果返回错误或超时 = 该模型不可用。
1C. 测试 Gemini 模型(newcli-gemini)
用 Google Generative AI 格式测试:
curl -s --max-time 15 \
"https://code.newcli.com/gemini/v1beta/models/<MODEL_ID>:generateContent" \
-H "x-goog-api-key: <你的API_KEY>" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"hi"}]}]}'
注意:Gemini 端点的 URL 格式与 Claude/GPT 不同——模型名嵌入在 URL 路径中,而不是请求体中。
如果返回正常的 JSON 响应(含 candidates)= 可用。
如果返回 {"error":{"message":"模型未开放"}} = 该模型不可用。
已知可用模型(截至 2026-02-08)
Claude 系列(newcli)
| 模型 ID | 名称 | Context | 说明 |
|---|---|---|---|
claude-opus-4-6 | Claude Opus 4.6 | 200K | 最强,适合复杂任务 |
claude-haiku-4-5-20251001 | Claude Haiku 4.5 | 200K | 轻量快速,适合简单任务 |
其他模型如
claude-sonnet-4-20250514等在文档中列出但实测可能返回"未开放",以你账户的实际情况为准。
GPT 系列(newcli-codex)
| 模型 ID | 名称 | Context | 说明 |
|---|---|---|---|
gpt-5.3-codex | GPT-5.3 Codex | 128K | 最新版本 |
gpt-5.2 | GPT-5.2 | 128K | 基础版 |
gpt-5.2-codex | GPT-5.2 Codex | 128K | 代码增强版 |
gpt-5.1 | GPT-5.1 | 128K | 基础版 |
gpt-5.1-codex | GPT-5.1 Codex | 128K | 代码增强版 |
gpt-5.1-codex-mini | GPT-5.1 Codex Mini | 128K | 轻量版 |
gpt-5.1-codex-max | GPT-5.1 Codex Max | 128K | 增强版 |
gpt-5 | GPT-5 | 128K | 基础版 |
gpt-5-codex | GPT-5 Codex | 128K | 代码增强版 |
Gemini 系列(newcli-gemini)— 文本对话模型
| 模型 ID | 名称 | Context | reasoning | 说明 |
|---|---|---|---|---|
gemini-3-pro | Gemini 3 Pro | 1M | ✅ | 最新旗舰 |
gemini-3-pro-high | Gemini 3 Pro High | 1M | ✅ | 旗舰增强版 |
gemini-3-pro-preview | Gemini 3 Pro Preview | 1M | ✅ | 预览版 |
gemini-3-flash | Gemini 3 Flash | 1M | ❌ | 快速版 |
gemini-3-flash-preview | Gemini 3 Flash Preview | 1M | ❌ | 快速预览版 |
gemini-2.5-pro | Gemini 2.5 Pro | 1M | ✅ | 上一代旗舰 |
gemini-2.5-flash | Gemini 2.5 Flash | 1M | ❌ | 上一代快速版 |
gemini-2.5-flash-lite | Gemini 2.5 Flash Lite | 1M | ❌ | 轻量版 |
Gemini 系列(newcli-gemini)— 图片生成模型
这些模型用于生成图片,不要加入 fallback 链,但可以通过 /model 命令手动切换使用。
基础分辨率(默认):
| 模型 ID | 说明 |
|---|---|
gemini-3-pro-image | 默认比例 |
gemini-3-pro-image-3x2 | 横向 3:2 |
gemini-3-pro-image-2x3 | 纵向 2:3 |
gemini-3-pro-image-3x4 | 纵向 3:4 |
gemini-3-pro-image-4x3 | 横向 4:3 |
gemini-3-pro-image-4x5 | 纵向 4:5 |
gemini-3-pro-image-5x4 | 横向 5:4 |
gemini-3-pro-image-9x16 | 竖屏 9:16 |
gemini-3-pro-image-16x9 | 宽屏 16:9 |
gemini-3-pro-image-21x9 | 超宽 21:9 |
2K 分辨率: 模型 ID 加 -2k 前缀,如 gemini-3-pro-image-2k、gemini-3-pro-image-2k-16x9 等。
4K 分辨率: 模型 ID 加 -4k 前缀,如 gemini-3-pro-image-4k、gemini-3-pro-image-4k-16x9 等。
⚠️ 图片生成模型不要加入 fallback 链——它们不适合文本对话,放进 fallback 会导致对话请求被错误路由到图片生成模型。需要生图时通过
/model gemini-3-pro-image手动切换。
第二步:添加 Provider
在 ~/.openclaw/openclaw.json 的 models.providers 下添加三个 provider。
2A. 添加 newcli(Claude 主线路)
"newcli": {
"baseUrl": "https://code.newcli.com/claude",
"apiKey": "<你的API_KEY>",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "claude-haiku-4-5-20251001",
"name": "Claude Haiku 4.5",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
2B. 添加 newcli-aws(Claude AWS 特价线路)⭐
"newcli-aws": {
"baseUrl": "https://code.newcli.com/claude/aws",
"apiKey": "<你的API_KEY>",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6 (AWS)",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "claude-haiku-4-5-20251001",
"name": "Claude Haiku 4.5 (AWS)",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
与 newcli 的唯一区别:
baseUrl从.../claude变为.../claude/aws。模型列表、API Key、协议完全相同。 推荐:重要 Agent(如运维、评审)优先使用newcli-aws,主线路newcli作为备用。
2C. 添加 newcli-codex(GPT 系列)
"newcli-codex": {
"baseUrl": "https://code.newcli.com/codex/v1",
"apiKey": "<你的API_KEY>",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.3-codex", "name": "GPT-5.3 Codex",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.2", "name": "GPT-5.2",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.2-codex", "name": "GPT-5.2 Codex",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.1", "name": "GPT-5.1",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.1-codex", "name": "GPT-5.1 Codex",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.1-codex-mini", "name": "GPT-5.1 Codex Mini",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5.1-codex-max", "name": "GPT-5.1 Codex Max",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5", "name": "GPT-5",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
},
{
"id": "gpt-5-codex", "name": "GPT-5 Codex",
"reasoning": false, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 128000, "maxTokens": 8192
}
]
}
2D. 添加 newcli-gemini(Gemini 系列)
"newcli-gemini": {
"baseUrl": "https://code.newcli.com/gemini/v1beta",
"apiKey": "<你的API_KEY>",
"api": "google-generative-ai",
"models": [
{
"id": "gemini-3-pro", "name": "Gemini 3 Pro",
"reasoning": true, "input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000, "maxTokens": 65536
},
{
"id": "gemini-3-pro-high", "name": "Gemini 3
---
*Content truncated.*
More by openclaw
View all skills by openclaw →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.