yymaxapi 1.0.121 → 1.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -47,22 +47,22 @@ set OPENCLAW_CODEX_KEY=你的Key && npx yymaxapi@latest preset-codex
|
|
|
47
47
|
**方式四:完全自动化(无交互)**
|
|
48
48
|
```bash
|
|
49
49
|
# macOS/Linux
|
|
50
|
-
OPENCLAW_CLAUDE_KEY="你的Key" npx yymaxapi@latest preset-claude --model claude-opus-4-
|
|
50
|
+
OPENCLAW_CLAUDE_KEY="你的Key" npx yymaxapi@latest preset-claude --model claude-opus-4-8 --set-primary true --force --test true
|
|
51
51
|
|
|
52
52
|
# Windows PowerShell
|
|
53
|
-
$env:OPENCLAW_CLAUDE_KEY="你的Key"; npx yymaxapi@latest preset-claude --model claude-opus-4-
|
|
53
|
+
$env:OPENCLAW_CLAUDE_KEY="你的Key"; npx yymaxapi@latest preset-claude --model claude-opus-4-8 --set-primary true --force --test true
|
|
54
54
|
|
|
55
55
|
# Windows CMD
|
|
56
|
-
set OPENCLAW_CLAUDE_KEY=你的Key && npx yymaxapi@latest preset-claude --model claude-opus-4-
|
|
56
|
+
set OPENCLAW_CLAUDE_KEY=你的Key && npx yymaxapi@latest preset-claude --model claude-opus-4-8 --set-primary true --force --test true
|
|
57
57
|
|
|
58
58
|
# macOS/Linux
|
|
59
|
-
OPENCLAW_CODEX_KEY="你的Key" npx yymaxapi@latest preset-codex --model gpt-5.
|
|
59
|
+
OPENCLAW_CODEX_KEY="你的Key" npx yymaxapi@latest preset-codex --model gpt-5.5 --set-primary true --force --test true
|
|
60
60
|
|
|
61
61
|
# Windows PowerShell
|
|
62
|
-
$env:OPENCLAW_CODEX_KEY="你的Key"; npx yymaxapi@latest preset-codex --model gpt-5.
|
|
62
|
+
$env:OPENCLAW_CODEX_KEY="你的Key"; npx yymaxapi@latest preset-codex --model gpt-5.5 --set-primary true --force --test true
|
|
63
63
|
|
|
64
64
|
# Windows CMD
|
|
65
|
-
set OPENCLAW_CODEX_KEY=你的Key && npx yymaxapi@latest preset-codex --model gpt-5.
|
|
65
|
+
set OPENCLAW_CODEX_KEY=你的Key && npx yymaxapi@latest preset-codex --model gpt-5.5 --set-primary true --force --test true
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
## 重要说明
|
package/bin/yymaxapi.js
CHANGED
|
@@ -99,13 +99,17 @@ const FALLBACK_ENDPOINTS = [
|
|
|
99
99
|
|
|
100
100
|
const DEFAULT_CLAUDE_MODELS = [
|
|
101
101
|
{
|
|
102
|
-
"id": "claude-
|
|
103
|
-
"name": "Claude
|
|
102
|
+
"id": "claude-opus-4-8",
|
|
103
|
+
"name": "Claude Opus 4.8"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"id": "claude-opus-4-7",
|
|
107
107
|
"name": "Claude Opus 4.7"
|
|
108
108
|
},
|
|
109
|
+
{
|
|
110
|
+
"id": "claude-sonnet-4-6",
|
|
111
|
+
"name": "Claude Sonnet 4.6"
|
|
112
|
+
},
|
|
109
113
|
{
|
|
110
114
|
"id": "claude-haiku-4-5",
|
|
111
115
|
"name": "Claude Haiku 4.5"
|
|
@@ -113,6 +117,10 @@ const DEFAULT_CLAUDE_MODELS = [
|
|
|
113
117
|
];
|
|
114
118
|
|
|
115
119
|
const DEFAULT_CODEX_MODELS = [
|
|
120
|
+
{
|
|
121
|
+
"id": "gpt-5.5",
|
|
122
|
+
"name": "GPT 5.5"
|
|
123
|
+
},
|
|
116
124
|
{
|
|
117
125
|
"id": "gpt-5.4",
|
|
118
126
|
"name": "GPT 5.4"
|
|
@@ -127,8 +135,8 @@ const DEFAULT_API_CONFIG = {
|
|
|
127
135
|
"claude": {
|
|
128
136
|
"urlSuffix": "/claude",
|
|
129
137
|
"api": "anthropic-messages",
|
|
130
|
-
"contextWindow":
|
|
131
|
-
"maxTokens":
|
|
138
|
+
"contextWindow": 1000000,
|
|
139
|
+
"maxTokens": 128000,
|
|
132
140
|
"providerName": "yunyi-claude"
|
|
133
141
|
},
|
|
134
142
|
"codex": {
|
|
@@ -243,11 +251,11 @@ const CODEX_MODELS = PRESETS.models.codex;
|
|
|
243
251
|
const API_CONFIG = PRESETS.apiConfig;
|
|
244
252
|
|
|
245
253
|
function getDefaultClaudeModel() {
|
|
246
|
-
return CLAUDE_MODELS[0] || { id: 'claude-
|
|
254
|
+
return CLAUDE_MODELS[0] || { id: 'claude-opus-4-8', name: 'Claude Opus 4.8' };
|
|
247
255
|
}
|
|
248
256
|
|
|
249
257
|
function getDefaultCodexModel() {
|
|
250
|
-
return CODEX_MODELS[0] || { id: 'gpt-5.
|
|
258
|
+
return CODEX_MODELS[0] || { id: 'gpt-5.5', name: 'GPT 5.5' };
|
|
251
259
|
}
|
|
252
260
|
|
|
253
261
|
function getExternalClaudeProviderKey() {
|
|
@@ -1137,7 +1145,7 @@ function writeClaudeCodeSettings(baseUrl, apiKey, modelId = getDefaultClaudeMode
|
|
|
1137
1145
|
}
|
|
1138
1146
|
const normalizedBaseUrl = baseUrl.replace(/\/+$/, '');
|
|
1139
1147
|
const normalizedModelId = String(modelId || getDefaultClaudeModel().id).trim() || getDefaultClaudeModel().id;
|
|
1140
|
-
const pinnedOpusModel = (CLAUDE_MODELS.find(model => /opus/i.test(model.id)) || {}).id || 'claude-opus-4-
|
|
1148
|
+
const pinnedOpusModel = (CLAUDE_MODELS.find(model => /opus/i.test(model.id)) || {}).id || 'claude-opus-4-8';
|
|
1141
1149
|
const pinnedSonnetModel = (CLAUDE_MODELS.find(model => /sonnet/i.test(model.id)) || {}).id || 'claude-sonnet-4-6';
|
|
1142
1150
|
const pinnedHaikuModel = (CLAUDE_MODELS.find(model => /haiku/i.test(model.id)) || {}).id || 'claude-haiku-4-5';
|
|
1143
1151
|
settings.apiBaseUrl = normalizedBaseUrl;
|
|
@@ -1156,7 +1164,7 @@ function writeClaudeCodeSettings(baseUrl, apiKey, modelId = getDefaultClaudeMode
|
|
|
1156
1164
|
} catch { /* 非关键,静默失败 */ }
|
|
1157
1165
|
}
|
|
1158
1166
|
|
|
1159
|
-
function writeCodexConfig(baseUrl, apiKey, modelId = 'gpt-5.
|
|
1167
|
+
function writeCodexConfig(baseUrl, apiKey, modelId = 'gpt-5.5') {
|
|
1160
1168
|
const codexDir = path.join(os.homedir(), '.codex');
|
|
1161
1169
|
if (!fs.existsSync(codexDir)) fs.mkdirSync(codexDir, { recursive: true });
|
|
1162
1170
|
|
|
@@ -1191,6 +1199,7 @@ function writeCodexConfig(baseUrl, apiKey, modelId = 'gpt-5.4') {
|
|
|
1191
1199
|
}
|
|
1192
1200
|
existing = existing.replace(/\[model_providers\.openclaw-relay\]\n(?:(?!\[)[^\n]*\n?)*/g, '');
|
|
1193
1201
|
existing = existing.replace(/# >>> yunyi opencode >>>[\s\S]*?# <<< yunyi opencode <<<\n?/g, '');
|
|
1202
|
+
existing = existing.replace(/# >>> maxapi opencode >>>[\s\S]*?# <<< maxapi opencode <<<\n?/g, '');
|
|
1194
1203
|
existing = existing.replace(/\n{3,}/g, '\n\n').trim();
|
|
1195
1204
|
}
|
|
1196
1205
|
const hasExistingTopLevelModelConfig = /^model\s*=\s*"[^"]*"\s*$/m.test(existing)
|
|
@@ -1309,19 +1318,54 @@ function writeOpencodeConfig(claudeBaseUrl, codexBaseUrl, apiKey, defaultModelKe
|
|
|
1309
1318
|
content = fs.readFileSync(codexConfigPath, 'utf8');
|
|
1310
1319
|
}
|
|
1311
1320
|
|
|
1312
|
-
// 移除旧标记块(仅移除
|
|
1321
|
+
// 移除旧标记块(仅移除 opencode 自己写入的兼容 provider)
|
|
1313
1322
|
content = content.replace(/# >>> yunyi opencode >>>[\s\S]*?# <<< yunyi opencode <<<\n?/g, '');
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1323
|
+
content = content.replace(/# >>> maxapi opencode >>>[\s\S]*?# <<< maxapi opencode <<<\n?/g, '');
|
|
1324
|
+
|
|
1325
|
+
// 移除旧版 yunyi-cli / maxai-cli 写入的同名 provider,随后写入当前受管块
|
|
1326
|
+
const removableProviderKeys = [
|
|
1327
|
+
'yunyi',
|
|
1328
|
+
'yunyi-claude',
|
|
1329
|
+
'yunyi-codex',
|
|
1330
|
+
'maxapi',
|
|
1331
|
+
'maxapi-codex',
|
|
1332
|
+
claudeProviderKey,
|
|
1333
|
+
codexProviderKey
|
|
1334
|
+
];
|
|
1335
|
+
for (const providerKey of [...new Set(removableProviderKeys)]) {
|
|
1336
|
+
const escapedProviderKey = escapeRegExp(providerKey);
|
|
1337
|
+
content = content.replace(new RegExp(`\\[model_providers\\.${escapedProviderKey}\\]\\n(?:(?!\\[)[^\\n]*\\n?)*`, 'g'), '');
|
|
1338
|
+
}
|
|
1318
1339
|
|
|
1319
1340
|
// 清理多余空行
|
|
1320
1341
|
content = content.replace(/\n{3,}/g, '\n\n').trim();
|
|
1321
1342
|
|
|
1322
|
-
|
|
1343
|
+
const markerPrefix = claudeProviderKey.startsWith('maxapi') || codexProviderKey.startsWith('maxapi') ? 'maxapi' : 'yunyi';
|
|
1344
|
+
const marker = `# >>> ${markerPrefix} opencode >>>`;
|
|
1345
|
+
const markerEnd = `# <<< ${markerPrefix} opencode <<<`;
|
|
1346
|
+
let normalizedCodexTomlUrl = codexUrl;
|
|
1347
|
+
if (normalizedCodexTomlUrl && !normalizedCodexTomlUrl.endsWith('/v1')) normalizedCodexTomlUrl += '/v1';
|
|
1348
|
+
|
|
1349
|
+
const opencodeProviderBlock = [
|
|
1350
|
+
marker,
|
|
1351
|
+
`[model_providers.${claudeProviderKey}]`,
|
|
1352
|
+
`name = "${brandPrefix} Claude"`,
|
|
1353
|
+
`base_url = "${claudeUrl}/v1"`,
|
|
1354
|
+
`wire_api = "anthropic"`,
|
|
1355
|
+
`experimental_bearer_token = "${apiKey}"`,
|
|
1356
|
+
...(normalizedCodexTomlUrl ? [
|
|
1357
|
+
'',
|
|
1358
|
+
`[model_providers.${codexProviderKey}]`,
|
|
1359
|
+
`name = "${brandPrefix} Codex"`,
|
|
1360
|
+
`base_url = "${normalizedCodexTomlUrl}"`,
|
|
1361
|
+
`wire_api = "responses"`,
|
|
1362
|
+
`experimental_bearer_token = "${apiKey}"`
|
|
1363
|
+
] : []),
|
|
1364
|
+
markerEnd
|
|
1365
|
+
].join('\n');
|
|
1323
1366
|
|
|
1324
|
-
|
|
1367
|
+
const nextContent = [content, opencodeProviderBlock].filter(Boolean).join('\n\n') + '\n';
|
|
1368
|
+
fs.writeFileSync(codexConfigPath, nextContent, 'utf8');
|
|
1325
1369
|
|
|
1326
1370
|
// ---- 3. ~/.codex/auth.json ----
|
|
1327
1371
|
const authPath = path.join(codexDir, 'auth.json');
|
|
@@ -2325,15 +2369,15 @@ const YYMAXAPI_OPENCLAW_MAIN_AGENT_ID = 'main';
|
|
|
2325
2369
|
const YYMAXAPI_OPENCLAW_ALT_CLAUDE_AGENT_ID = 'yunyi-claude';
|
|
2326
2370
|
const YYMAXAPI_OPENCLAW_GPT_AGENT_ID = 'yunyi-gpt';
|
|
2327
2371
|
const YYMAXAPI_OPENCLAW_LEGACY_GPT_AGENT_IDS = ['gpt'];
|
|
2328
|
-
const YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY = `${YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER}/claude-
|
|
2372
|
+
const YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY = `${YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER}/claude-opus-4-8`;
|
|
2329
2373
|
const YYMAXAPI_OPENCLAW_CLAUDE_FALLBACK = `${YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER}/claude-opus-4-7`;
|
|
2330
|
-
const YYMAXAPI_OPENCLAW_GPT_PRIMARY = `${YYMAXAPI_OPENCLAW_GPT_PROVIDER}/gpt-5.
|
|
2331
|
-
const YYMAXAPI_OPENCLAW_GPT_FALLBACK = `${YYMAXAPI_OPENCLAW_GPT_PROVIDER}/gpt-5.
|
|
2374
|
+
const YYMAXAPI_OPENCLAW_GPT_PRIMARY = `${YYMAXAPI_OPENCLAW_GPT_PROVIDER}/gpt-5.5`;
|
|
2375
|
+
const YYMAXAPI_OPENCLAW_GPT_FALLBACK = `${YYMAXAPI_OPENCLAW_GPT_PROVIDER}/gpt-5.4`;
|
|
2332
2376
|
const YYMAXAPI_MANAGED_MAIN_NAMES = new Set(['Claude', 'claude', 'yunyi-claude', 'claude-yunyi']);
|
|
2333
2377
|
const YYMAXAPI_MANAGED_GPT_NAMES = new Set(['GPT', 'Codex', 'gpt', 'yunyi-gpt', 'yunyi-codex']);
|
|
2334
2378
|
const YYMAXAPI_MANAGED_MULTIMODAL_MODELS = {
|
|
2335
|
-
claude: new Set(['claude-
|
|
2336
|
-
codex: new Set(['gpt-5.4', 'gpt-5.3-codex'])
|
|
2379
|
+
claude: new Set(['claude-opus-4-8', 'claude-opus-4-7', 'claude-sonnet-4-6', 'claude-haiku-4-5']),
|
|
2380
|
+
codex: new Set(['gpt-5.5', 'gpt-5.4', 'gpt-5.3-codex'])
|
|
2337
2381
|
};
|
|
2338
2382
|
|
|
2339
2383
|
function isYymaxapiOpenClawBuild() {
|
|
@@ -2386,7 +2430,7 @@ function getManagedYunyiModelInput(type, modelId) {
|
|
|
2386
2430
|
|
|
2387
2431
|
function getManagedYunyiProviderModels(type) {
|
|
2388
2432
|
const apiConfig = type === 'claude'
|
|
2389
|
-
? { contextWindow: API_CONFIG.claude?.contextWindow ||
|
|
2433
|
+
? { contextWindow: API_CONFIG.claude?.contextWindow || 1000000, maxTokens: API_CONFIG.claude?.maxTokens || 128000 }
|
|
2390
2434
|
: { contextWindow: API_CONFIG.codex?.contextWindow || 1000000, maxTokens: API_CONFIG.codex?.maxTokens || 128000 };
|
|
2391
2435
|
|
|
2392
2436
|
return getManagedYunyiModelCatalog(type).map(model => ({
|
|
@@ -2455,7 +2499,7 @@ function normalizeManagedYunyiModelState(type, modelState = {}, options = {}) {
|
|
|
2455
2499
|
const canPreserve = !options.force && currentPrimary && knownKeys.includes(currentPrimary);
|
|
2456
2500
|
const primary = canPreserve ? currentPrimary : fallbackPrimary;
|
|
2457
2501
|
|
|
2458
|
-
let fallbacks = Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
2502
|
+
let fallbacks = !options.force && Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
2459
2503
|
fallbacks = [...new Set(
|
|
2460
2504
|
fallbacks
|
|
2461
2505
|
.map(item => canonicalizeManagedYunyiModelKey(item, type))
|
|
@@ -2476,7 +2520,7 @@ function normalizeManagedYunyiDefaultsModel(modelState = {}, options = {}) {
|
|
|
2476
2520
|
? canonicalizeManagedYunyiModelKey(currentPrimary)
|
|
2477
2521
|
: YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY;
|
|
2478
2522
|
|
|
2479
|
-
let fallbacks = Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
2523
|
+
let fallbacks = !options.force && Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
2480
2524
|
fallbacks = [...new Set(
|
|
2481
2525
|
fallbacks
|
|
2482
2526
|
.map(item => {
|
|
@@ -2968,7 +3012,7 @@ function normalizeManagedYunyiImageModel(modelState = {}, options = {}) {
|
|
|
2968
3012
|
? canonicalizeManagedYunyiModelKey(currentPrimary)
|
|
2969
3013
|
: YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY;
|
|
2970
3014
|
|
|
2971
|
-
let fallbacks = Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
3015
|
+
let fallbacks = !options.force && Array.isArray(modelState.fallbacks) ? modelState.fallbacks : [];
|
|
2972
3016
|
fallbacks = [...new Set(
|
|
2973
3017
|
fallbacks
|
|
2974
3018
|
.map(item => {
|
|
@@ -3026,21 +3070,30 @@ function applyManagedYunyiOpenClawLayout(config, options = {}) {
|
|
|
3026
3070
|
ensureConfigStructure(config);
|
|
3027
3071
|
|
|
3028
3072
|
const endpointUrl = inferManagedYunyiEndpointUrl(config, options.endpointUrl);
|
|
3029
|
-
const
|
|
3073
|
+
const sharedApiKey = String(options.apiKey || '').trim();
|
|
3074
|
+
const fallbackApiKey = inferManagedYunyiApiKey(config, sharedApiKey);
|
|
3030
3075
|
if (!endpointUrl) {
|
|
3031
3076
|
return { changed: false, applied: false, claudeAgentId: null, preservedMain: false };
|
|
3032
3077
|
}
|
|
3033
3078
|
|
|
3034
3079
|
let changed = false;
|
|
3035
3080
|
const providers = config.models.providers;
|
|
3036
|
-
|
|
3037
|
-
|
|
3081
|
+
const claudeApiKey = sharedApiKey
|
|
3082
|
+
|| String(options.claudeApiKey || options.claudeKey || '').trim()
|
|
3083
|
+
|| String(providers[YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER]?.apiKey || '').trim()
|
|
3084
|
+
|| fallbackApiKey;
|
|
3085
|
+
const gptApiKey = sharedApiKey
|
|
3086
|
+
|| String(options.codexApiKey || options.codexKey || options.gptApiKey || options.gptKey || '').trim()
|
|
3087
|
+
|| String(providers[YYMAXAPI_OPENCLAW_GPT_PROVIDER]?.apiKey || '').trim()
|
|
3088
|
+
|| fallbackApiKey;
|
|
3089
|
+
|
|
3090
|
+
const nextClaudeProvider = buildManagedYunyiProviderConfig('claude', endpointUrl, claudeApiKey, providers[YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER] || {});
|
|
3038
3091
|
if (JSON.stringify(nextClaudeProvider) !== JSON.stringify(providers[YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER] || {})) {
|
|
3039
3092
|
providers[YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER] = nextClaudeProvider;
|
|
3040
3093
|
changed = true;
|
|
3041
3094
|
}
|
|
3042
3095
|
|
|
3043
|
-
const nextGptProvider = buildManagedYunyiProviderConfig('codex', endpointUrl,
|
|
3096
|
+
const nextGptProvider = buildManagedYunyiProviderConfig('codex', endpointUrl, gptApiKey, providers[YYMAXAPI_OPENCLAW_GPT_PROVIDER] || {});
|
|
3044
3097
|
if (JSON.stringify(nextGptProvider) !== JSON.stringify(providers[YYMAXAPI_OPENCLAW_GPT_PROVIDER] || {})) {
|
|
3045
3098
|
providers[YYMAXAPI_OPENCLAW_GPT_PROVIDER] = nextGptProvider;
|
|
3046
3099
|
changed = true;
|
|
@@ -3077,7 +3130,16 @@ function applyManagedYunyiOpenClawLayout(config, options = {}) {
|
|
|
3077
3130
|
}
|
|
3078
3131
|
|
|
3079
3132
|
if (shouldManageYunyiImageDefaults(config)) {
|
|
3080
|
-
const
|
|
3133
|
+
const hasExplicitImageModel = config.agents.defaults.imageModel
|
|
3134
|
+
&& typeof config.agents.defaults.imageModel === 'object'
|
|
3135
|
+
&& !Array.isArray(config.agents.defaults.imageModel)
|
|
3136
|
+
&& (
|
|
3137
|
+
typeof config.agents.defaults.imageModel.primary === 'string'
|
|
3138
|
+
|| Array.isArray(config.agents.defaults.imageModel.fallbacks)
|
|
3139
|
+
);
|
|
3140
|
+
const currentImageModel = hasExplicitImageModel
|
|
3141
|
+
? normalizeDefaultModelSelection(config.agents.defaults.imageModel, config)
|
|
3142
|
+
: {};
|
|
3081
3143
|
const nextImageModel = normalizeManagedYunyiImageModel(currentImageModel, options);
|
|
3082
3144
|
if (JSON.stringify(currentImageModel) !== JSON.stringify(nextImageModel)) {
|
|
3083
3145
|
config.agents.defaults.imageModel = nextImageModel;
|
|
@@ -5597,10 +5659,10 @@ async function autoActivate(paths, args = {}) {
|
|
|
5597
5659
|
const isClaudePrimary = selectedType === 'claude';
|
|
5598
5660
|
const claudeModelId = isClaudePrimary
|
|
5599
5661
|
? selectedModelId
|
|
5600
|
-
: CLAUDE_MODELS[0]?.id || 'claude-
|
|
5662
|
+
: CLAUDE_MODELS[0]?.id || 'claude-opus-4-8';
|
|
5601
5663
|
const codexModelId = !isClaudePrimary
|
|
5602
5664
|
? selectedModelId
|
|
5603
|
-
: CODEX_MODELS[0]?.id || 'gpt-5.
|
|
5665
|
+
: CODEX_MODELS[0]?.id || 'gpt-5.5';
|
|
5604
5666
|
|
|
5605
5667
|
const claudeModel = CLAUDE_MODELS.find(m => m.id === claudeModelId) || { id: claudeModelId, name: claudeModelId };
|
|
5606
5668
|
const codexModel = CODEX_MODELS.find(m => m.id === codexModelId) || { id: codexModelId, name: codexModelId };
|
|
@@ -7458,7 +7520,7 @@ function testClaudeApi(baseUrl, apiKey, model) {
|
|
|
7458
7520
|
const protocol = urlObj.protocol === 'https:' ? https : http;
|
|
7459
7521
|
|
|
7460
7522
|
const postData = JSON.stringify({
|
|
7461
|
-
model: model || 'claude-
|
|
7523
|
+
model: model || 'claude-opus-4-8',
|
|
7462
7524
|
max_tokens: 150,
|
|
7463
7525
|
messages: [{ role: 'user', content: '你是哪个模型?请用一句话回答你的模型名称和版本。' }]
|
|
7464
7526
|
});
|
|
@@ -7518,7 +7580,7 @@ function testCodexApi(baseUrl, apiKey, model) {
|
|
|
7518
7580
|
const protocol = urlObj.protocol === 'https:' ? https : http;
|
|
7519
7581
|
|
|
7520
7582
|
const postData = JSON.stringify({
|
|
7521
|
-
model: model || 'gpt-5.
|
|
7583
|
+
model: model || 'gpt-5.5',
|
|
7522
7584
|
input: '你是哪个模型?请用一句话回答你的模型名称和版本。'
|
|
7523
7585
|
});
|
|
7524
7586
|
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
{
|
|
15
15
|
"endpoints": [
|
|
16
16
|
{ "name": "默认主节点", "url": "https://yunyi.yun" },
|
|
17
|
-
{ "name": "
|
|
17
|
+
{ "name": "备用 CDN 域名 1", "url": "https://cdn1.yunyi.yun" },
|
|
18
|
+
{ "name": "备用 CDN 域名 2", "url": "https://cdn2.yunyi.yun" }
|
|
18
19
|
],
|
|
19
20
|
"fallbackEndpoints": [
|
|
20
21
|
{ "name": "备用节点1", "url": "http://47.99.42.193" },
|
|
@@ -22,11 +23,13 @@
|
|
|
22
23
|
],
|
|
23
24
|
"models": {
|
|
24
25
|
"claude": [
|
|
25
|
-
{ "id": "claude-
|
|
26
|
+
{ "id": "claude-opus-4-8", "name": "Claude Opus 4.8" },
|
|
26
27
|
{ "id": "claude-opus-4-7", "name": "Claude Opus 4.7" },
|
|
28
|
+
{ "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6" },
|
|
27
29
|
{ "id": "claude-haiku-4-5", "name": "Claude Haiku 4.5" }
|
|
28
30
|
],
|
|
29
31
|
"codex": [
|
|
32
|
+
{ "id": "gpt-5.5", "name": "GPT 5.5" },
|
|
30
33
|
{ "id": "gpt-5.4", "name": "GPT 5.4" },
|
|
31
34
|
{ "id": "gpt-5.3-codex", "name": "GPT 5.3 Codex" }
|
|
32
35
|
]
|
|
@@ -35,8 +38,8 @@
|
|
|
35
38
|
"claude": {
|
|
36
39
|
"urlSuffix": "/claude",
|
|
37
40
|
"api": "anthropic-messages",
|
|
38
|
-
"contextWindow":
|
|
39
|
-
"maxTokens":
|
|
41
|
+
"contextWindow": 1000000,
|
|
42
|
+
"maxTokens": 128000,
|
|
40
43
|
"providerName": "yunyi-claude"
|
|
41
44
|
},
|
|
42
45
|
"codex": {
|
|
@@ -70,7 +73,7 @@ npx yymaxapi@latest
|
|
|
70
73
|
|
|
71
74
|
在腾讯云 OpenClaw 部署中,使用「自定义模型」接入云翼中转,已验证可用的配置:
|
|
72
75
|
|
|
73
|
-
### Claude
|
|
76
|
+
### Claude Opus 4.8
|
|
74
77
|
|
|
75
78
|
```json
|
|
76
79
|
{
|
|
@@ -79,13 +82,13 @@ npx yymaxapi@latest
|
|
|
79
82
|
"api": "anthropic-messages",
|
|
80
83
|
"api_key": "<你的云翼 API Key>",
|
|
81
84
|
"model": {
|
|
82
|
-
"id": "claude-
|
|
83
|
-
"name": "Claude
|
|
85
|
+
"id": "claude-opus-4-8",
|
|
86
|
+
"name": "Claude Opus 4.8"
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
### GPT 5.
|
|
91
|
+
### GPT 5.5
|
|
89
92
|
|
|
90
93
|
```json
|
|
91
94
|
{
|
|
@@ -94,8 +97,8 @@ npx yymaxapi@latest
|
|
|
94
97
|
"api": "openai-completions",
|
|
95
98
|
"api_key": "<你的云翼 API Key>",
|
|
96
99
|
"model": {
|
|
97
|
-
"id": "gpt-5.
|
|
98
|
-
"name": "GPT 5.
|
|
100
|
+
"id": "gpt-5.5",
|
|
101
|
+
"name": "GPT 5.5"
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
```
|
|
@@ -103,8 +106,11 @@ npx yymaxapi@latest
|
|
|
103
106
|
**注意事项:**
|
|
104
107
|
- `base_url` 不要加 `/v1`,平台会自动拼接路径
|
|
105
108
|
- 如需临时切到其他云翼域名,可直接把域名部分替换掉;`yymaxapi` 也支持在预设/一键激活命令中传 `--endpoint-url https://你的域名` 或 `--base-url https://你的域名/claude`
|
|
106
|
-
- Claude 可用模型:`claude-
|
|
107
|
-
-
|
|
109
|
+
- Claude 可用模型:`claude-opus-4-8`、`claude-opus-4-7`、`claude-sonnet-4-6`、`claude-haiku-4-5`
|
|
110
|
+
- Claude 默认模型:`claude-opus-4-8`
|
|
111
|
+
- `claude-opus-4-8` 按当前官方规格声明为 1M context / 128K max output
|
|
112
|
+
- GPT 可用模型:`gpt-5.5`、`gpt-5.4`、`gpt-5.3-codex`
|
|
113
|
+
- GPT 默认模型:`gpt-5.5`
|
|
108
114
|
- 已验证环境:腾讯云 OpenCloudOS,OpenClaw `2026.2.3-1`
|
|
109
115
|
- 参考文档:https://cloud.tencent.com/developer/article/2624003
|
|
110
116
|
|
|
@@ -116,7 +122,7 @@ npx yymaxapi@latest
|
|
|
116
122
|
|
|
117
123
|
在腾讯云 OpenClaw 的「自定义模型」里添加**两条**,`api_key` 用同一云翼 Key 即可。
|
|
118
124
|
|
|
119
|
-
第一条 — Claude
|
|
125
|
+
第一条 — Claude Opus 4.8:
|
|
120
126
|
|
|
121
127
|
```json
|
|
122
128
|
{
|
|
@@ -125,13 +131,13 @@ npx yymaxapi@latest
|
|
|
125
131
|
"api": "anthropic-messages",
|
|
126
132
|
"api_key": "<你的云翼 API Key>",
|
|
127
133
|
"model": {
|
|
128
|
-
"id": "claude-
|
|
129
|
-
"name": "Claude
|
|
134
|
+
"id": "claude-opus-4-8",
|
|
135
|
+
"name": "Claude Opus 4.8"
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
```
|
|
133
139
|
|
|
134
|
-
第二条 — GPT 5.
|
|
140
|
+
第二条 — GPT 5.5:
|
|
135
141
|
|
|
136
142
|
```json
|
|
137
143
|
{
|
|
@@ -140,8 +146,8 @@ npx yymaxapi@latest
|
|
|
140
146
|
"api": "openai-completions",
|
|
141
147
|
"api_key": "<你的云翼 API Key>",
|
|
142
148
|
"model": {
|
|
143
|
-
"id": "gpt-5.
|
|
144
|
-
"name": "GPT 5.
|
|
149
|
+
"id": "gpt-5.5",
|
|
150
|
+
"name": "GPT 5.5"
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
153
|
```
|