yymaxapi 1.0.33 → 1.0.34
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/bin/yymaxapi.js +11 -5
- package/package.json +1 -1
package/bin/yymaxapi.js
CHANGED
|
@@ -640,6 +640,10 @@ function writeCodexConfig(baseUrl, apiKey) {
|
|
|
640
640
|
const configPath = path.join(codexDir, 'config.toml');
|
|
641
641
|
const marker = '# >>> maxapi codex >>>';
|
|
642
642
|
const markerEnd = '# <<< maxapi codex <<<';
|
|
643
|
+
const providerKey = 'openclaw-relay';
|
|
644
|
+
// 确保 base_url 以 /v1 结尾(Codex CLI 要求)
|
|
645
|
+
let normalizedUrl = baseUrl.replace(/\/+$/, '');
|
|
646
|
+
if (!normalizedUrl.endsWith('/v1')) normalizedUrl += '/v1';
|
|
643
647
|
try {
|
|
644
648
|
let existing = '';
|
|
645
649
|
if (fs.existsSync(configPath)) {
|
|
@@ -650,12 +654,14 @@ function writeCodexConfig(baseUrl, apiKey) {
|
|
|
650
654
|
}
|
|
651
655
|
const section = [
|
|
652
656
|
marker,
|
|
653
|
-
`model = "
|
|
654
|
-
`
|
|
657
|
+
`model = "gpt-5.3-codex"`,
|
|
658
|
+
`model_provider = "${providerKey}"`,
|
|
655
659
|
``,
|
|
656
|
-
`[
|
|
657
|
-
`
|
|
658
|
-
`base_url = "${
|
|
660
|
+
`[model_providers.${providerKey}]`,
|
|
661
|
+
`name = "OpenClaw Relay"`,
|
|
662
|
+
`base_url = "${normalizedUrl}"`,
|
|
663
|
+
`wire_api = "responses"`,
|
|
664
|
+
`env_key = "OPENAI_API_KEY"`,
|
|
659
665
|
markerEnd
|
|
660
666
|
].join('\n');
|
|
661
667
|
const content = existing ? `${existing}\n\n${section}\n` : `${section}\n`;
|