提供商設定指南
本指南涵蓋 Claudex 支援的每個提供商的詳細設定說明,包括 API 金鑰提供商、OAuth 訂閱、雲端平台和本地模型。
API 金鑰提供商
Section titled “API 金鑰提供商”Anthropic
Section titled “Anthropic”- 在 console.anthropic.com 註冊
- 前往 API Keys 並建立新金鑰(格式:
sk-ant-*)
[[profiles]]name = "anthropic"provider_type = "DirectAnthropic"base_url = "https://api.anthropic.com"api_key = "sk-ant-..."default_model = "claude-sonnet-4-20250514"claudex profile test anthropicMiniMax
Section titled “MiniMax”- 在 platform.minimaxi.com 註冊
- 前往主控台中的 API Keys
[[profiles]]name = "minimax"provider_type = "DirectAnthropic"base_url = "https://api.minimax.io/anthropic"api_key = "..."default_model = "claude-sonnet-4-20250514"claudex profile test minimaxOpenRouter
Section titled “OpenRouter”- 在 openrouter.ai 註冊
- 在 openrouter.ai/keys 取得你的 API 金鑰
[[profiles]]name = "openrouter"provider_type = "OpenAICompatible"base_url = "https://openrouter.ai/api/v1"api_key = "sk-or-..."default_model = "anthropic/claude-sonnet-4"claudex profile test openrouterGrok (xAI)
Section titled “Grok (xAI)”- 在 console.x.ai 註冊
- 在主控台中建立 API 金鑰
[[profiles]]name = "grok"provider_type = "OpenAICompatible"base_url = "https://api.x.ai/v1"api_key = "xai-..."default_model = "grok-3-beta"claudex profile test grokOpenAI
Section titled “OpenAI”- 在 platform.openai.com 註冊
- 在 platform.openai.com/api-keys 建立 API 金鑰
[[profiles]]name = "chatgpt"provider_type = "OpenAICompatible"base_url = "https://api.openai.com/v1"api_key = "sk-..."default_model = "gpt-4o"claudex profile test chatgptDeepSeek
Section titled “DeepSeek”- 在 platform.deepseek.com 註冊
- 在主控台中建立 API 金鑰
[[profiles]]name = "deepseek"provider_type = "OpenAICompatible"base_url = "https://api.deepseek.com"api_key = "sk-..."default_model = "deepseek-chat"claudex profile test deepseekKimi / Moonshot
Section titled “Kimi / Moonshot”- 在 platform.moonshot.cn 註冊
- 在主控台中建立 API 金鑰
[[profiles]]name = "kimi"provider_type = "OpenAICompatible"base_url = "https://api.moonshot.ai/v1"api_key = "sk-..."default_model = "kimi-k2-0905-preview"claudex profile test kimiGLM / Zhipu
Section titled “GLM / Zhipu”- 在 open.bigmodel.cn 註冊
- 在主控台中建立 API 金鑰
[[profiles]]name = "glm"provider_type = "OpenAICompatible"base_url = "https://api.z.ai/api/paas/v4"api_key = "..."default_model = "glm-4.6"claudex profile test glm- 在 console.groq.com 註冊
- 在 Settings > API Keys 建立 API 金鑰
[[profiles]]name = "groq"provider_type = "OpenAICompatible"base_url = "https://api.groq.com/openai/v1"api_key = "gsk_..."default_model = "llama-3.3-70b-versatile"claudex profile test groqMistral AI
Section titled “Mistral AI”- 在 console.mistral.ai 註冊
- 在主控台中建立 API 金鑰
[[profiles]]name = "mistral"provider_type = "OpenAICompatible"base_url = "https://api.mistral.ai/v1"api_key = "..."default_model = "mistral-large-latest"claudex profile test mistralTogether AI
Section titled “Together AI”- 在 api.together.ai 註冊
- 在儀表板中建立 API 金鑰
[[profiles]]name = "together"provider_type = "OpenAICompatible"base_url = "https://api.together.xyz/v1"api_key = "..."default_model = "meta-llama/Llama-3.3-70B-Instruct-Turbo"claudex profile test togetherPerplexity
Section titled “Perplexity”- 在 perplexity.ai 註冊
- 在 perplexity.ai/settings/api 建立 API 金鑰
[[profiles]]name = "perplexity"provider_type = "OpenAICompatible"base_url = "https://api.perplexity.ai"api_key = "pplx-..."default_model = "sonar-pro"claudex profile test perplexityCerebras
Section titled “Cerebras”- 在 cloud.cerebras.ai 註冊
- 在儀表板中建立 API 金鑰
[[profiles]]name = "cerebras"provider_type = "OpenAICompatible"base_url = "https://api.cerebras.ai/v1"api_key = "..."default_model = "llama-3.3-70b"claudex profile test cerebrasAzure OpenAI
Section titled “Azure OpenAI”- 在 Azure Portal 建立 Azure OpenAI 資源
- 部署模型並記下資源名稱和部署名稱
- 從 Keys and Endpoint 取得 API 金鑰
[[profiles]]name = "azure-openai"provider_type = "OpenAICompatible"base_url = "https://YOUR_RESOURCE.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT"api_key = "YOUR_AZURE_KEY"default_model = "gpt-4o"
[profiles.query_params]api-version = "2024-12-01-preview"claudex profile test azure-openaiGoogle Vertex AI
Section titled “Google Vertex AI”- 在 GCP 專案中啟用 Vertex AI API
- 使用
gcloud auth print-access-token產生存取權杖
[[profiles]]name = "vertex-ai"provider_type = "DirectAnthropic"base_url = "https://us-east5-aiplatform.googleapis.com/v1/projects/YOUR_PROJECT/locations/us-east5/publishers/anthropic/models"api_key = "YOUR_GCLOUD_TOKEN"default_model = "claude-sonnet-4@20250514"claudex profile test vertex-aiAWS Bedrock(透過 LiteLLM)
Section titled “AWS Bedrock(透過 LiteLLM)”AWS Bedrock 透過 LiteLLM 代理支援:
- 安裝 LiteLLM:
pip install litellm - 啟動代理:
litellm --model bedrock/anthropic.claude-sonnet-4-20250514-v2:0- 設定 Claudex:
[[profiles]]name = "bedrock"provider_type = "OpenAICompatible"base_url = "http://localhost:4000/v1"api_key = "sk-litellm"default_model = "bedrock/anthropic.claude-sonnet-4-20250514-v2:0"OAuth 訂閱
Section titled “OAuth 訂閱”OAuth 認證讓你可以使用現有的提供商訂閱(ChatGPT Plus、Claude Max 等),無需單獨的 API 金鑰。
Claude Max / Pro
Section titled “Claude Max / Pro”透過 Claude Code 的原生 OAuth 工作階段使用你現有的 Claude 訂閱。
先決條件:已安裝並登入 Claude Code(claude 指令正常運作)
[[profiles]]name = "claude-max"provider_type = "DirectAnthropic"base_url = "https://api.claude.ai"default_model = "claude-sonnet-4-20250514"auth_type = "oauth"oauth_provider = "claude"
[profiles.models]haiku = "claude-haiku-4-20250514"sonnet = "claude-sonnet-4-20250514"opus = "claude-opus-4-20250514"ChatGPT Plus / Codex CLI
Section titled “ChatGPT Plus / Codex CLI”透過 Codex CLI token 使用你的 ChatGPT Plus 或 Pro 訂閱。
先決條件:安裝 Codex CLI 並完成認證:
# 安裝 Codex CLInpm install -g @openai/codex
# 認證(開啟瀏覽器)codex auth然後設定 Claudex:
[[profiles]]name = "codex-sub"provider_type = "OpenAIResponses"base_url = "https://chatgpt.com/backend-api/codex"default_model = "gpt-5.3-codex"auth_type = "oauth"oauth_provider = "openai"
[profiles.models]haiku = "codex-mini-latest"sonnet = "gpt-5.3-codex"opus = "gpt-5.3-codex"# 從 Codex CLI 讀取 tokenclaudex auth login openai --profile codex-sub
# 驗證claudex auth status
# 執行claudex run codex-subGoogle Gemini
Section titled “Google Gemini”透過 Gemini CLI 憑證使用你的 Google 帳戶。
[[profiles]]name = "gemini-sub"provider_type = "OpenAICompatible"base_url = "https://generativelanguage.googleapis.com/v1beta/openai"default_model = "gemini-2.5-pro"auth_type = "oauth"oauth_provider = "google"
[profiles.models]haiku = "gemini-2.0-flash"sonnet = "gemini-2.5-pro"opus = "gemini-2.5-pro"# 登入時從 Gemini CLI 憑證讀取claudex auth login google --profile gemini-sub
# 驗證claudex auth statusQwen / 通義千問
Section titled “Qwen / 通義千問”透過 OAuth Device Code 流程使用你的 Qwen 帳戶。
[[profiles]]name = "qwen-oauth"provider_type = "OpenAICompatible"base_url = "https://chat.qwen.ai/api"default_model = "qwen3-235b-a22b"auth_type = "oauth"oauth_provider = "qwen"# 啟動 Device Code 流程claudex auth login qwen --profile qwen-oauth
# 驗證claudex auth statusKimi / Moonshot(OAuth)
Section titled “Kimi / Moonshot(OAuth)”透過 Kimi CLI 憑證使用你的 Kimi 帳戶。
[[profiles]]name = "kimi-oauth"provider_type = "OpenAICompatible"base_url = "https://api.moonshot.cn/v1"default_model = "moonshot-v1-128k"auth_type = "oauth"oauth_provider = "kimi"# 登入時從 Kimi CLI 憑證讀取claudex auth login kimi --profile kimi-oauth
# 驗證claudex auth statusGitHub Copilot
Section titled “GitHub Copilot”透過 OAuth Device Code 流程使用你的 GitHub Copilot 訂閱。
[[profiles]]name = "copilot"provider_type = "OpenAICompatible"base_url = "https://api.githubcopilot.com"default_model = "gpt-4o"auth_type = "oauth"oauth_provider = "github"# 啟動 Device Code 流程(開啟瀏覽器進行 GitHub 登入)claudex auth login github --profile copilot
# 驗證claudex auth statusGitLab Duo
Section titled “GitLab Duo”透過 Personal Access Token 使用你的 GitLab Duo 訂閱。
[[profiles]]name = "gitlab-duo"provider_type = "OpenAICompatible"base_url = "https://gitlab.com/api/v4/ai/llm/proxy"default_model = "claude-sonnet-4-20250514"auth_type = "oauth"oauth_provider = "gitlab"# 將 GitLab token 設為環境變數export GITLAB_TOKEN=glpat-...
# 登入claudex auth login gitlab --profile gitlab-duo
# 驗證claudex auth statusOllama
Section titled “Ollama”- 安裝 Ollama:ollama.com
- 拉取模型:
ollama pull qwen2.5:72b- 設定 Claudex:
[[profiles]]name = "local-qwen"provider_type = "OpenAICompatible"base_url = "http://localhost:11434/v1"api_key = ""default_model = "qwen2.5:72b"claudex profile test local-qwen- 安裝並啟動 vLLM:
pip install vllmvllm serve meta-llama/Llama-3.3-70B-Instruct --port 8000- 設定 Claudex:
[[profiles]]name = "local-llama"provider_type = "OpenAICompatible"base_url = "http://localhost:8000/v1"api_key = ""default_model = "meta-llama/Llama-3.3-70B-Instruct"LM Studio
Section titled “LM Studio”- 從 lmstudio.ai 下載 LM Studio
- 載入模型並啟動本地伺服器(預設連接埠:1234)
[[profiles]]name = "lm-studio"provider_type = "OpenAICompatible"base_url = "http://localhost:1234/v1"api_key = "lm-studio"default_model = "local-model"驗證你的設定
Section titled “驗證你的設定”設定任何提供商後,驗證連線:
# 測試特定 profileclaudex profile test <profile-name>
# 測試所有 profileclaudex profile test all
# 列出所有已設定的 profileclaudex profile list