mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
feat(providers): add Minimax Coding (China) provider
- Add minimax-cn provider with China endpoint (api.minimaxi.com) - Add provider icon and configuration - Add validation and test support - Add API configuration in open-sse Co-authored-by: Blade096 <46746496+Blade096@users.noreply.github.com> Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -120,6 +120,14 @@ export const PROVIDERS = {
|
||||
"Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14"
|
||||
}
|
||||
},
|
||||
"minimax-cn": {
|
||||
baseUrl: "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
format: "claude",
|
||||
headers: {
|
||||
"Anthropic-Version": "2023-06-01",
|
||||
"Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14"
|
||||
}
|
||||
},
|
||||
github: {
|
||||
baseUrl: "https://api.githubcopilot.com/chat/completions", // GitHub Copilot API endpoint for chat
|
||||
format: "openai", // GitHub Copilot uses OpenAI-compatible format
|
||||
|
||||
@@ -189,6 +189,7 @@ export const PROVIDER_ID_TO_ALIAS = {
|
||||
glm: "glm",
|
||||
kimi: "kimi",
|
||||
minimax: "minimax",
|
||||
"minimax-cn": "minimax",
|
||||
};
|
||||
|
||||
export function getModelsByProviderId(providerId) {
|
||||
|
||||
@@ -23,6 +23,7 @@ export class DefaultExecutor extends BaseExecutor {
|
||||
case "glm":
|
||||
case "kimi":
|
||||
case "minimax":
|
||||
case "minimax-cn":
|
||||
return `${this.config.baseUrl}?beta=true`;
|
||||
case "gemini":
|
||||
return `${this.config.baseUrl}/${model}:${stream ? "streamGenerateContent?alt=sse" : "generateContent"}`;
|
||||
@@ -44,6 +45,7 @@ export class DefaultExecutor extends BaseExecutor {
|
||||
case "glm":
|
||||
case "kimi":
|
||||
case "minimax":
|
||||
case "minimax-cn":
|
||||
headers["x-api-key"] = credentials.apiKey;
|
||||
break;
|
||||
default:
|
||||
|
||||
BIN
public/providers/minimax-cn.png
Normal file
BIN
public/providers/minimax-cn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -406,9 +406,14 @@ async function testApiKeyConnection(connection) {
|
||||
return { valid, error: valid ? null : "Invalid API key" };
|
||||
}
|
||||
|
||||
case "minimax": {
|
||||
case "minimax":
|
||||
case "minimax-cn": {
|
||||
// MiniMax uses Claude-compatible API
|
||||
const res = await fetch("https://api.minimax.io/anthropic/v1/messages", {
|
||||
const minimaxEndpoints = {
|
||||
minimax: "https://api.minimax.io/anthropic/v1/messages",
|
||||
"minimax-cn": "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
};
|
||||
const res = await fetch(minimaxEndpoints[connection.provider], {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"x-api-key": connection.apiKey,
|
||||
|
||||
@@ -100,11 +100,13 @@ export async function POST(request) {
|
||||
|
||||
case "glm":
|
||||
case "kimi":
|
||||
case "minimax": {
|
||||
case "minimax":
|
||||
case "minimax-cn": {
|
||||
const claudeBaseUrls = {
|
||||
glm: "https://api.z.ai/api/anthropic/v1/messages",
|
||||
kimi: "https://api.kimi.com/coding/v1/messages",
|
||||
minimax: "https://api.minimax.io/anthropic/v1/messages",
|
||||
"minimax-cn": "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
};
|
||||
const claudeRes = await fetch(claudeBaseUrls[provider], {
|
||||
method: "POST",
|
||||
|
||||
@@ -35,6 +35,7 @@ export const PROVIDER_ENDPOINTS = {
|
||||
glm: "https://api.z.ai/api/anthropic/v1/messages",
|
||||
kimi: "https://api.kimi.com/coding/v1/messages",
|
||||
minimax: "https://api.minimax.io/anthropic/v1/messages",
|
||||
"minimax-cn": "https://api.minimaxi.com/anthropic/v1/messages",
|
||||
openai: "https://api.openai.com/v1/chat/completions",
|
||||
anthropic: "https://api.anthropic.com/v1/messages",
|
||||
gemini: "https://generativelanguage.googleapis.com/v1beta/models",
|
||||
|
||||
@@ -18,6 +18,7 @@ export const APIKEY_PROVIDERS = {
|
||||
glm: { id: "glm", alias: "glm", name: "GLM Coding", icon: "code", color: "#2563EB", textIcon: "GL" },
|
||||
kimi: { id: "kimi", alias: "kimi", name: "Kimi Coding", icon: "psychology", color: "#1E3A8A", textIcon: "KM" },
|
||||
minimax: { id: "minimax", alias: "minimax", name: "Minimax Coding", icon: "memory", color: "#7C3AED", textIcon: "MM" },
|
||||
"minimax-cn": { id: "minimax-cn", alias: "minimax-cn", name: "Minimax Coding (China)", icon: "memory", color: "#DC2626", textIcon: "MC" },
|
||||
openai: { id: "openai", alias: "openai", name: "OpenAI", icon: "auto_awesome", color: "#10A37F", textIcon: "OA" },
|
||||
anthropic: { id: "anthropic", alias: "anthropic", name: "Anthropic", icon: "smart_toy", color: "#D97757", textIcon: "AN" },
|
||||
gemini: { id: "gemini", alias: "gemini", name: "Gemini", icon: "diamond", color: "#4285F4", textIcon: "GE" },
|
||||
|
||||
Reference in New Issue
Block a user