OpenCode For Windows 自定义模型和接入点

C:\Users\用户名\.config\opencode\opencode.jsonc

{
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "Custom123": {
      "npm": "@ai-sdk/openai",
      "options": {
        "baseURL": "https://custom.com/v1",
        "apiKey": "sk-..."
      },
      "models": {

        "gpt-5-codex": {
          "name": "GPT-5 Codex",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 200000,
            "output": 16000
          }
        },

        "gpt-5-codex-mini": {
          "name": "GPT-5 Codex Mini",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 200000,
            "output": 16000
          }
        },

        "gpt-5.1-codex": {
          "name": "GPT-5.1 Codex",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 200000,
            "output": 16000
          }
        },

        "gpt-5.1-codex-max": {
          "name": "GPT-5.1 Codex Max",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 400000,
            "output": 32000
          }
        },

        "gpt-5.1-codex-mini": {
          "name": "GPT-5.1 Codex Mini",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 200000,
            "output": 16000
          }
        },

        "gpt-5.2-codex": {
          "name": "GPT-5.2 Codex",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 300000,
            "output": 32000
          }
        },

        "gpt-5.3-codex": {
          "name": "GPT-5.3 Codex",
          "reasoning": true,
          "attachment": false,
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 500000,
            "output": 64000
          }
        }

      }
    }
  }
}
}
posted @ 2026-02-24 19:34  jing砸鸭  阅读(224)  评论(0)    收藏  举报