add-newcli-provider

8
1
Source

为 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.zip

Installs to .claude/skills/add-newcli-provider

About this skill

配置 NewCLI Provider(code.newcli.com 模型代理源)

NewCLI (FoxCode) 是一个模型代理服务,通过统一的账户和 API Key 提供三类模型的访问:

Provider模型系列API 协议Base URL备注
newcliClaude (Anthropic)anthropic-messagescode.newcli.com/claude主线路
newcli-awsClaude (Anthropic)anthropic-messagescode.newcli.com/claude/awsAWS 特价线路,消耗 1/24
newcli-codexGPT (OpenAI)openai-completionscode.newcli.com/codex/v1
newcli-geminiGemini (Google)google-generative-aicode.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
额度消耗1x1/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-6Claude Opus 4.6200K最强,适合复杂任务
claude-haiku-4-5-20251001Claude Haiku 4.5200K轻量快速,适合简单任务

其他模型如 claude-sonnet-4-20250514 等在文档中列出但实测可能返回"未开放",以你账户的实际情况为准。

GPT 系列(newcli-codex)

模型 ID名称Context说明
gpt-5.3-codexGPT-5.3 Codex128K最新版本
gpt-5.2GPT-5.2128K基础版
gpt-5.2-codexGPT-5.2 Codex128K代码增强版
gpt-5.1GPT-5.1128K基础版
gpt-5.1-codexGPT-5.1 Codex128K代码增强版
gpt-5.1-codex-miniGPT-5.1 Codex Mini128K轻量版
gpt-5.1-codex-maxGPT-5.1 Codex Max128K增强版
gpt-5GPT-5128K基础版
gpt-5-codexGPT-5 Codex128K代码增强版

Gemini 系列(newcli-gemini)— 文本对话模型

模型 ID名称Contextreasoning说明
gemini-3-proGemini 3 Pro1M最新旗舰
gemini-3-pro-highGemini 3 Pro High1M旗舰增强版
gemini-3-pro-previewGemini 3 Pro Preview1M预览版
gemini-3-flashGemini 3 Flash1M快速版
gemini-3-flash-previewGemini 3 Flash Preview1M快速预览版
gemini-2.5-proGemini 2.5 Pro1M上一代旗舰
gemini-2.5-flashGemini 2.5 Flash1M上一代快速版
gemini-2.5-flash-liteGemini 2.5 Flash Lite1M轻量版

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-2kgemini-3-pro-image-2k-16x9 等。

4K 分辨率: 模型 ID 加 -4k 前缀,如 gemini-3-pro-image-4kgemini-3-pro-image-4k-16x9 等。

⚠️ 图片生成模型不要加入 fallback 链——它们不适合文本对话,放进 fallback 会导致对话请求被错误路由到图片生成模型。需要生图时通过 /model gemini-3-pro-image 手动切换。


第二步:添加 Provider

~/.openclaw/openclaw.jsonmodels.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.*

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.

1,6831,428

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

1,2601,319

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.

1,5281,144

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.

1,350807

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.

1,262727

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,474681