2025-12-31 00:04:32 +09:00
|
|
|
|
# AIプロバイダーの設定
|
|
|
|
|
|
|
|
|
|
|
|
このガイドでは、next-ai-draw-io でさまざまな AI モデルプロバイダーを設定する方法について説明します。
|
|
|
|
|
|
|
|
|
|
|
|
## クイックスタート
|
|
|
|
|
|
|
|
|
|
|
|
1. `.env.example` を `.env.local` にコピーします
|
|
|
|
|
|
2. 選択したプロバイダーの API キーを設定します
|
|
|
|
|
|
3. `AI_MODEL` を希望のモデルに設定します
|
|
|
|
|
|
4. `npm run dev` を実行します
|
|
|
|
|
|
|
|
|
|
|
|
## 対応プロバイダー
|
|
|
|
|
|
|
|
|
|
|
|
### Doubao (ByteDance Volcengine)
|
|
|
|
|
|
|
2026-03-16 20:48:39 +09:00
|
|
|
|
> **無料トークン**: [Volcengine ARK プラットフォーム](https://www.volcengine.com/activity/codingplan?ac=MMAP8JTTCAQ2&rc=Z9Z3LDTJ&utm_campaign=drawio&utm_content=drawio&utm_medium=devrel&utm_source=OWO&utm_term=drawio)に登録すると、すべてのモデルで使える50万トークンが無料で入手できます!
|
2025-12-31 00:04:32 +09:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
DOUBAO_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=doubao-seed-1-8-251215 # または他の Doubao モデル
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Google Gemini
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
GOOGLE_GENERATIVE_AI_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=gemini-2.0-flash
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
GOOGLE_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### OpenAI
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
OPENAI_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=gpt-4o
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント(OpenAI 互換サービス用):
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
OPENAI_BASE_URL=https://your-custom-endpoint/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-06-15 12:54:18 +08:00
|
|
|
|
### AIHubMix
|
|
|
|
|
|
|
|
|
|
|
|
AIHubMix は、単一の API キーで Claude、GPT、Gemini、DeepSeek などのモデルへのアクセスを提供します。
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AIHUBMIX_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=claude-sonnet-4-5-20250929
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AIHUBMIX_BASE_URL=https://aihubmix.com/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-31 00:04:32 +09:00
|
|
|
|
### Anthropic
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
ANTHROPIC_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=claude-sonnet-4-5-20250514
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-06-02 18:26:27 +08:00
|
|
|
|
または、Bearer 認証トークンを使用することもできます(OAuth スタイルのトークンを発行するゲートウェイ経由で利用する場合など)。`ANTHROPIC_AUTH_TOKEN` は `Authorization: Bearer <token>` ヘッダーで送信され、`ANTHROPIC_API_KEY` は `x-api-key` ヘッダーで送信されます。両者は排他的なので、いずれか一方のみを設定してください:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
ANTHROPIC_AUTH_TOKEN=your_auth_token
|
|
|
|
|
|
AI_MODEL=claude-sonnet-4-5-20250514
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-31 00:04:32 +09:00
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
ANTHROPIC_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### DeepSeek
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
DEEPSEEK_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=deepseek-chat
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
DEEPSEEK_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### SiliconFlow (OpenAI 互換)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
SILICONFLOW_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=deepseek-ai/DeepSeek-V3 # 例; 任意の SiliconFlow モデル ID を使用
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント(デフォルトは推奨ドメイン):
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
SILICONFLOW_BASE_URL=https://api.siliconflow.com/v1 # または https://api.siliconflow.cn/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### SGLang
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
SGLANG_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=your_model_id
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
SGLANG_BASE_URL=https://your-custom-endpoint/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Azure OpenAI
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AZURE_API_KEY=your_api_key
|
|
|
|
|
|
AZURE_RESOURCE_NAME=your-resource-name # 必須: Azure リソース名
|
|
|
|
|
|
AI_MODEL=your-deployment-name
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
またはリソース名の代わりにカスタムエンドポイントを使用:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AZURE_API_KEY=your_api_key
|
|
|
|
|
|
AZURE_BASE_URL=https://your-resource.openai.azure.com # AZURE_RESOURCE_NAME の代替
|
|
|
|
|
|
AI_MODEL=your-deployment-name
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意の推論設定:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AZURE_REASONING_EFFORT=low # 任意: low, medium, high
|
|
|
|
|
|
AZURE_REASONING_SUMMARY=detailed # 任意: none, brief, detailed
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### AWS Bedrock
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AWS_REGION=us-west-2
|
|
|
|
|
|
AWS_ACCESS_KEY_ID=your_access_key_id
|
|
|
|
|
|
AWS_SECRET_ACCESS_KEY=your_secret_access_key
|
|
|
|
|
|
AI_MODEL=anthropic.claude-sonnet-4-5-20250514-v1:0
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
注: AWS 上(IAM ロールを持つ Lambda や EC2)では、認証情報は IAM ロールから自動的に取得されます。
|
|
|
|
|
|
|
|
|
|
|
|
### OpenRouter
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
OPENROUTER_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=anthropic/claude-sonnet-4
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
OPENROUTER_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Ollama (ローカル)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AI_PROVIDER=ollama
|
|
|
|
|
|
AI_MODEL=llama3.2
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタム URL:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
OLLAMA_BASE_URL=http://localhost:11434
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-06 18:41:25 +08:00
|
|
|
|
### ModelScope
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
MODELSCOPE_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=Qwen/Qwen3-235B-A22B-Instruct-2507
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
任意のカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
MODELSCOPE_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-31 00:04:32 +09:00
|
|
|
|
### Vercel AI Gateway
|
|
|
|
|
|
|
|
|
|
|
|
Vercel AI Gateway は、単一の API キーで複数の AI プロバイダーへの統合アクセスを提供します。これにより認証が簡素化され、複数の API キーを管理することなくプロバイダーを切り替えることができます。
|
|
|
|
|
|
|
|
|
|
|
|
**基本的な使用法 (Vercel ホストの Gateway):**
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AI_GATEWAY_API_KEY=your_gateway_api_key
|
|
|
|
|
|
AI_MODEL=openai/gpt-4o
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
**カスタム Gateway URL (ローカル開発またはセルフホスト Gateway 用):**
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AI_GATEWAY_API_KEY=your_custom_api_key
|
|
|
|
|
|
AI_GATEWAY_BASE_URL=https://your-custom-gateway.com/v1/ai
|
|
|
|
|
|
AI_MODEL=openai/gpt-4o
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
モデル形式は `provider/model` 構文を使用します:
|
|
|
|
|
|
|
|
|
|
|
|
- `openai/gpt-4o` - OpenAI GPT-4o
|
|
|
|
|
|
- `anthropic/claude-sonnet-4-5` - Anthropic Claude Sonnet 4.5
|
|
|
|
|
|
- `google/gemini-2.0-flash` - Google Gemini 2.0 Flash
|
|
|
|
|
|
|
|
|
|
|
|
**設定に関する注意点:**
|
|
|
|
|
|
|
|
|
|
|
|
- `AI_GATEWAY_BASE_URL` が設定されていない場合、デフォルトの Vercel Gateway URL (`https://ai-gateway.vercel.sh/v1/ai`) が使用されます
|
|
|
|
|
|
- カスタムベース URL は以下の場合に便利です:
|
|
|
|
|
|
- カスタム Gateway インスタンスを使用したローカル開発
|
|
|
|
|
|
- セルフホスト AI Gateway デプロイメント
|
|
|
|
|
|
- エンタープライズプロキシ設定
|
|
|
|
|
|
- カスタムベース URL を使用する場合、`AI_GATEWAY_API_KEY` も指定する必要があります
|
|
|
|
|
|
|
|
|
|
|
|
[Vercel AI Gateway ダッシュボード](https://vercel.com/ai-gateway)から API キーを取得してください。
|
|
|
|
|
|
|
feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
* feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
- Add minimax, glm, qwen, qiniu, kimi to ProviderName type
- Add provider configurations to PROVIDER_INFO with default base URLs
- Add suggested models for MiniMax in SUGGESTED_MODELS
- Add minimax/glm/qwen/qiniu/kimi cases to getAIModel using OpenAI-compatible SDK
- Update ALLOWED_CLIENT_PROVIDERS and error messages
- Add environment variable examples to env.example
Fixes: MiniMax API compatibility issue (invalid chat setting 2013)
* fix: Add missing providers to PROVIDER_ENV_VARS type
* fix: Handle null case in PROVIDER_ENV_VARS for new providers
* fix: Add minimax/glm/qwen/kimi/qiniu support to validate-model API
- Add getDefaultBaseUrl helper function
- Add validation cases for new providers in validate-model route
* fix: Add new providers to buildProviderOptions switch case
* fix: Merge multiple system messages into one for minimax/glm/qwen/kimi/qiniu
MiniMax API doesn't support multiple system messages.
This fix combines them into a single message for Chinese providers.
* fix: Handle null provider in system message check
* debug: Add logging for allMessages count
* fix: Use effective provider (including env var fallback) for isSingleSystemProvider check
* fix: apply biome formatting (line-wrapping)
* docs: add Chinese AI providers documentation (MiniMax, GLM, Qwen, Kimi, Qiniu)
- Add i18n translations for new providers in all language dictionaries
- Add provider configuration documentation in en/cn/ja docs
* fix: 改进 PR #722 的代码审查反馈
1. 删除重复的 getDefaultBaseUrl 函数,改用 model-config.ts 的 PROVIDER_INFO
2. validate-model 路由改用 AI SDK 的 createOpenAI + generateText
3. 修复 resolveBaseURL 回退逻辑,传入 PROVIDER_INFO 的 defaultBaseUrl
4. 删除无用的 .bak 备份文件
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 修正中国 AI provider 端点配置
- qiniu: api.qiniucdn.com → api.qnaigc.com
- qwen: dashscope.aliyun.com → dashscope.aliyuncs.com
- 更新 env.example 文档链接
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* feat: MiniMax 使用 Anthropic 兼容 API
- MiniMax 改用 createAnthropic (而非 createOpenAI)
- 支持 api.minimax.io/anthropic 和 api.minimaxi.com/anthropic
- 合并多个 system 消息为单个 (MiniMax/GLM/Qwen/Kimi/Qiniu)
- 更新默认模型为 MiniMax-M2.5 系列
- 支持 MINIMAX_BASE_URL 环境变量配置
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* docs: 更新 MiniMax 文档
- 添加 Anthropic 兼容 API 说明
- 更新默认模型为 MiniMax-M2.5
- 添加国际版/中国大陆版配置示例
- 更新 env.example 注释
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 完善 MiniMax 双端点支持及问题修复
- 支持 MiniMax Anthropic 兼容端点和 OpenAI 兼容端点自动切换
- 修正默认端点为 api.minimaxi.com (中国大陆可用)
- 修复端点路径缺少 /v1 的问题
- 添加前端 MiniMax logo 映射
- 移除调试日志
- 修正 env.example 默认配置
* chore: clean backup artifacts and align biome formatting
* fix: resolve effectiveProvider bug, deduplicate MiniMax URL logic, fix docs
- Fix critical bug: effectiveProvider was empty during auto-detection,
causing multi-system-message to be sent to MiniMax (which rejects it).
Now uses resolved provider from getAIModel instead of re-deriving it.
- Extract normalizeMiniMaxBaseURL() shared helper to eliminate duplication
between ai-providers.ts and validate-model/route.ts
- Add guard for undefined MiniMax baseURL to prevent hitting api.anthropic.com
- Fix docs: mark China mainland URL as default (matches code behavior)
- Restructure minimax/glm/qwen/kimi/qiniu validation to use shared pattern
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: document MiniMax dual API formats in docs and UI
- Add hint below Base URL input when MiniMax is selected, explaining
Anthropic-compatible (/anthropic) vs OpenAI-compatible (/v1) endpoints
- Update all 3 ai-providers docs (en/cn/ja) to list all 4 endpoint options
(China/International × Anthropic/OpenAI)
- Add i18n translations for the hint in all 4 locales
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: deduplicate PROVIDER_LOGO_MAP, remove unnecessary optional chaining
- Extract PROVIDER_LOGO_MAP to lib/types/model-config.ts (was duplicated
in model-config-dialog.tsx and model-selector.tsx)
- Remove unnecessary ?. on PROVIDER_INFO.minimax (it's a full Record)
---------
Co-authored-by: msga-oc <msga-oc@gitea.misakiga.top>
Co-authored-by: Shinyi <shinyi@openclaw.ai>
Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:53:47 +08:00
|
|
|
|
### MiniMax
|
|
|
|
|
|
|
|
|
|
|
|
MiniMax は 2 つの API 形式をサポートしています:
|
|
|
|
|
|
- **Anthropic 互換**(`/anthropic` エンドポイント)— 推奨、インターリーブ思考をサポート
|
|
|
|
|
|
- **OpenAI 互換**(`/v1` エンドポイント)— 標準 OpenAI チャット補完形式
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
MINIMAX_API_KEY=your_api_key
|
2026-06-02 18:38:49 +08:00
|
|
|
|
AI_MODEL=MiniMax-M3
|
feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
* feat: Add support for Chinese AI providers (GLM, Qwen, Kimi, MiniMax, Qiniu)
- Add minimax, glm, qwen, qiniu, kimi to ProviderName type
- Add provider configurations to PROVIDER_INFO with default base URLs
- Add suggested models for MiniMax in SUGGESTED_MODELS
- Add minimax/glm/qwen/qiniu/kimi cases to getAIModel using OpenAI-compatible SDK
- Update ALLOWED_CLIENT_PROVIDERS and error messages
- Add environment variable examples to env.example
Fixes: MiniMax API compatibility issue (invalid chat setting 2013)
* fix: Add missing providers to PROVIDER_ENV_VARS type
* fix: Handle null case in PROVIDER_ENV_VARS for new providers
* fix: Add minimax/glm/qwen/kimi/qiniu support to validate-model API
- Add getDefaultBaseUrl helper function
- Add validation cases for new providers in validate-model route
* fix: Add new providers to buildProviderOptions switch case
* fix: Merge multiple system messages into one for minimax/glm/qwen/kimi/qiniu
MiniMax API doesn't support multiple system messages.
This fix combines them into a single message for Chinese providers.
* fix: Handle null provider in system message check
* debug: Add logging for allMessages count
* fix: Use effective provider (including env var fallback) for isSingleSystemProvider check
* fix: apply biome formatting (line-wrapping)
* docs: add Chinese AI providers documentation (MiniMax, GLM, Qwen, Kimi, Qiniu)
- Add i18n translations for new providers in all language dictionaries
- Add provider configuration documentation in en/cn/ja docs
* fix: 改进 PR #722 的代码审查反馈
1. 删除重复的 getDefaultBaseUrl 函数,改用 model-config.ts 的 PROVIDER_INFO
2. validate-model 路由改用 AI SDK 的 createOpenAI + generateText
3. 修复 resolveBaseURL 回退逻辑,传入 PROVIDER_INFO 的 defaultBaseUrl
4. 删除无用的 .bak 备份文件
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 修正中国 AI provider 端点配置
- qiniu: api.qiniucdn.com → api.qnaigc.com
- qwen: dashscope.aliyun.com → dashscope.aliyuncs.com
- 更新 env.example 文档链接
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* feat: MiniMax 使用 Anthropic 兼容 API
- MiniMax 改用 createAnthropic (而非 createOpenAI)
- 支持 api.minimax.io/anthropic 和 api.minimaxi.com/anthropic
- 合并多个 system 消息为单个 (MiniMax/GLM/Qwen/Kimi/Qiniu)
- 更新默认模型为 MiniMax-M2.5 系列
- 支持 MINIMAX_BASE_URL 环境变量配置
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* docs: 更新 MiniMax 文档
- 添加 Anthropic 兼容 API 说明
- 更新默认模型为 MiniMax-M2.5
- 添加国际版/中国大陆版配置示例
- 更新 env.example 注释
Co-authored-by: Shinyi <shinyi@openclaw.ai>
* fix: 完善 MiniMax 双端点支持及问题修复
- 支持 MiniMax Anthropic 兼容端点和 OpenAI 兼容端点自动切换
- 修正默认端点为 api.minimaxi.com (中国大陆可用)
- 修复端点路径缺少 /v1 的问题
- 添加前端 MiniMax logo 映射
- 移除调试日志
- 修正 env.example 默认配置
* chore: clean backup artifacts and align biome formatting
* fix: resolve effectiveProvider bug, deduplicate MiniMax URL logic, fix docs
- Fix critical bug: effectiveProvider was empty during auto-detection,
causing multi-system-message to be sent to MiniMax (which rejects it).
Now uses resolved provider from getAIModel instead of re-deriving it.
- Extract normalizeMiniMaxBaseURL() shared helper to eliminate duplication
between ai-providers.ts and validate-model/route.ts
- Add guard for undefined MiniMax baseURL to prevent hitting api.anthropic.com
- Fix docs: mark China mainland URL as default (matches code behavior)
- Restructure minimax/glm/qwen/kimi/qiniu validation to use shared pattern
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: document MiniMax dual API formats in docs and UI
- Add hint below Base URL input when MiniMax is selected, explaining
Anthropic-compatible (/anthropic) vs OpenAI-compatible (/v1) endpoints
- Update all 3 ai-providers docs (en/cn/ja) to list all 4 endpoint options
(China/International × Anthropic/OpenAI)
- Add i18n translations for the hint in all 4 locales
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: deduplicate PROVIDER_LOGO_MAP, remove unnecessary optional chaining
- Extract PROVIDER_LOGO_MAP to lib/types/model-config.ts (was duplicated
in model-config-dialog.tsx and model-selector.tsx)
- Remove unnecessary ?. on PROVIDER_INFO.minimax (it's a full Record)
---------
Co-authored-by: msga-oc <msga-oc@gitea.misakiga.top>
Co-authored-by: Shinyi <shinyi@openclaw.ai>
Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:53:47 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプション設定:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
# 中国大陸版、Anthropic 互換(デフォルト)
|
|
|
|
|
|
MINIMAX_BASE_URL=https://api.minimaxi.com/anthropic
|
|
|
|
|
|
|
|
|
|
|
|
# 中国大陸版、OpenAI 互換
|
|
|
|
|
|
MINIMAX_BASE_URL=https://api.minimaxi.com/v1
|
|
|
|
|
|
|
|
|
|
|
|
# 国際版、Anthropic 互換
|
|
|
|
|
|
MINIMAX_BASE_URL=https://api.minimax.io/anthropic
|
|
|
|
|
|
|
|
|
|
|
|
# 国際版、OpenAI 互換
|
|
|
|
|
|
MINIMAX_BASE_URL=https://api.minimax.io/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### GLM (Zhipu AI)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
GLM_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=glm-4
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプションのカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
GLM_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Qwen (Alibaba Cloud)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
QWEN_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=qwen-turbo
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプションのカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
QWEN_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Kimi (Moonshot AI)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
KIMI_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=kimi-latest
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプションのカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
KIMI_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Qiniu (Qiniu Cloud)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
QINIU_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=your_model_id
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプションのカスタムエンドポイント:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
QINIU_BASE_URL=https://your-custom-endpoint
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-07-12 08:10:12 +08:00
|
|
|
|
### MiMo (Xiaomi)
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
MIMO_API_KEY=your_api_key
|
|
|
|
|
|
AI_MODEL=mimo-v2.5-pro
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
オプションのカスタムエンドポイント(Token Plan 加入者は専用の Base URL を設定してください):
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
MIMO_BASE_URL=https://token-plan-cn.xiaomimimo.com/v1
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-12-31 00:04:32 +09:00
|
|
|
|
## 自動検出
|
|
|
|
|
|
|
|
|
|
|
|
**1つ**のプロバイダーの API キーのみを設定した場合、システムはそのプロバイダーを自動的に検出して使用します。`AI_PROVIDER` を設定する必要はありません。
|
|
|
|
|
|
|
|
|
|
|
|
**複数**の API キーを設定する場合は、`AI_PROVIDER` を明示的に設定する必要があります:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-07-12 08:10:12 +08:00
|
|
|
|
AI_PROVIDER=google # または: openai, anthropic, aihubmix, deepseek, siliconflow, doubao, azure, bedrock, openrouter, ollama, gateway, sglang, modelscope, minimax, glm, qwen, kimi, qiniu, mimo
|
2025-12-31 00:04:32 +09:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-15 21:28:22 +05:30
|
|
|
|
## サーバーサイドマルチモデル設定
|
|
|
|
|
|
|
|
|
|
|
|
管理者は、ユーザーが個人のAPIキーを提供することなく利用できる複数のサーバーサイドモデルを設定できます。
|
|
|
|
|
|
|
|
|
|
|
|
### 設定方法
|
|
|
|
|
|
|
|
|
|
|
|
**方法1:環境変数**(クラウドデプロイ推奨)
|
|
|
|
|
|
|
|
|
|
|
|
`AI_MODELS_CONFIG` をJSON文字列として設定:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AI_MODELS_CONFIG='{"providers":[{"name":"OpenAI","provider":"openai","models":["gpt-4o"],"default":true}]}'
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
**方法2:設定ファイル**
|
|
|
|
|
|
|
|
|
|
|
|
プロジェクトルートに `ai-models.json` ファイルを作成します(または `AI_MODELS_CONFIG_PATH` でパスを指定)。
|
|
|
|
|
|
|
2026-06-15 14:27:55 +09:00
|
|
|
|
**方法3:`AI_MODEL` をカンマ区切りで指定**(単一プロバイダーの簡易設定)
|
|
|
|
|
|
|
|
|
|
|
|
同一プロバイダー内の複数モデルだけを公開したい場合は、`AI_MODEL` にカンマ区切りで列挙できます。最初のモデルがデフォルトになります。
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
AI_PROVIDER=doubao
|
|
|
|
|
|
AI_MODEL=doubao-seed-1-8-251215,doubao-seed-1-6-flash,doubao-seed-1-6-pro
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
これは等価な `ai-models.json` の簡易表記です。複数のプロバイダーや、カスタム `apiKeyEnv` / `baseUrlEnv` を使う場合は、方法1または方法2を使ってください。
|
|
|
|
|
|
|
2026-01-15 21:28:22 +05:30
|
|
|
|
### 設定例
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"providers": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"name": "OpenAI Production",
|
|
|
|
|
|
"provider": "openai",
|
|
|
|
|
|
"models": ["gpt-4o", "gpt-4o-mini"],
|
|
|
|
|
|
"default": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"name": "Custom DeepSeek",
|
|
|
|
|
|
"provider": "deepseek",
|
|
|
|
|
|
"models": ["deepseek-chat"],
|
|
|
|
|
|
"apiKeyEnv": "MY_DEEPSEEK_KEY",
|
|
|
|
|
|
"baseUrlEnv": "MY_DEEPSEEK_URL"
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### フィールド説明
|
|
|
|
|
|
|
|
|
|
|
|
| フィールド | 必須 | 説明 |
|
|
|
|
|
|
|------------|------|------|
|
|
|
|
|
|
| `name` | はい | 表示名(同一プロバイダーの複数設定をサポート) |
|
|
|
|
|
|
| `provider` | はい | プロバイダータイプ(`openai`, `anthropic`, `google`, `bedrock` など) |
|
|
|
|
|
|
| `models` | はい | モデルIDのリスト |
|
|
|
|
|
|
| `default` | いいえ | `true` に設定すると、そのプロバイダーの最初のモデルがデフォルトで選択されます |
|
|
|
|
|
|
| `apiKeyEnv` | いいえ | カスタムAPIキー環境変数名(デフォルトは `OPENAI_API_KEY` などの標準変数) |
|
|
|
|
|
|
| `baseUrlEnv` | いいえ | カスタムBase URL環境変数名 |
|
|
|
|
|
|
|
|
|
|
|
|
### 備考
|
|
|
|
|
|
|
|
|
|
|
|
- APIキーと認証情報は環境変数で提供します。デフォルトは標準変数名(例:`OPENAI_API_KEY`)を使用しますが、`apiKeyEnv` でカスタム変数名を指定できます。
|
|
|
|
|
|
- `name` フィールドにより同一プロバイダーの複数設定が可能です(例:「OpenAI Production」と「OpenAI Staging」が両方とも `provider: "openai"` を使用しつつ、異なる `apiKeyEnv` を持つ)。
|
|
|
|
|
|
- 設定が存在しない場合、アプリは `AI_PROVIDER`/`AI_MODEL` 環境変数設定にフォールバックします。
|
|
|
|
|
|
|
2025-12-31 00:04:32 +09:00
|
|
|
|
## モデル性能要件
|
|
|
|
|
|
|
|
|
|
|
|
このタスクは、厳密なフォーマット制約(draw.io XML)を伴う長文テキストの生成を含むため、非常に強力なモデル性能が必要です。
|
|
|
|
|
|
|
|
|
|
|
|
**推奨モデル**:
|
|
|
|
|
|
|
|
|
|
|
|
- Claude Sonnet 4.5 / Opus 4.5
|
|
|
|
|
|
|
|
|
|
|
|
**Ollama に関する注意**: Ollama はプロバイダーとしてサポートされていますが、DeepSeek R1 や Qwen3-235B のような高性能モデルをローカルで実行していない限り、このユースケースでは一般的に実用的ではありません。
|
|
|
|
|
|
|
|
|
|
|
|
## Temperature(温度)設定
|
|
|
|
|
|
|
|
|
|
|
|
環境変数で Temperature を任意に設定できます:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
TEMPERATURE=0 # より決定論的な出力(ダイアグラムに推奨)
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
**重要**: 以下の Temperature 設定をサポートしていないモデルでは、`TEMPERATURE` を未設定のままにしてください:
|
|
|
|
|
|
- GPT-5.1 およびその他の推論モデル
|
|
|
|
|
|
- 一部の特殊なモデル
|
|
|
|
|
|
|
|
|
|
|
|
未設定の場合、モデルはデフォルトの挙動を使用します。
|
|
|
|
|
|
|
|
|
|
|
|
## 推奨事項
|
|
|
|
|
|
|
|
|
|
|
|
- **最高の体験**: 画像からダイアグラムを生成する機能には、ビジョン(画像認識)をサポートするモデル(GPT-4o, Claude, Gemini)を使用してください
|
|
|
|
|
|
- **低コスト**: DeepSeek は競争力のある価格を提供しています
|
|
|
|
|
|
- **プライバシー**: 完全にローカルなオフライン操作には Ollama を使用してください(強力なハードウェアが必要です)
|
|
|
|
|
|
- **柔軟性**: OpenRouter は単一の API で多数のモデルへのアクセスを提供します
|