Skip to content

Commit 8b82854

Browse files
committed
Add MiniMax provider
1 parent ed38ba5 commit 8b82854

6 files changed

Lines changed: 38 additions & 2 deletions

File tree

src/app/api/setup/check-provider/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ export async function POST(req: Request) {
521521
case 'fireworks':
522522
case 'nebius':
523523
case 'requesty':
524-
case 'deepinfra': {
524+
case 'deepinfra':
525+
case 'minimax': {
525526
const info = OPENAI_COMPATIBLE_DEFAULTS[provider]
526527
if (!apiKey) return NextResponse.json({ ok: false, message: `${info.name} API key is required.` })
527528
const result = await checkOpenAiCompatible(info.name, apiKey, endpoint, info.defaultEndpoint, model)

src/lib/providers/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,27 @@ export const PROVIDERS: Record<string, BuiltinProviderConfig> = {
510510
},
511511
},
512512
},
513+
minimax: {
514+
id: 'minimax',
515+
name: 'MiniMax',
516+
// MiniMax exposes an OpenAI-compatible chat completions API. The global
517+
// endpoint (https://api.minimax.io/v1) is the default; callers can point
518+
// apiEndpoint at the China endpoint (https://api.minimaxi.com/v1) or the
519+
// Anthropic-compatible endpoint (https://api.minimax.io/anthropic).
520+
models: ['MiniMax-M3', 'MiniMax-M2.7'],
521+
requiresApiKey: true,
522+
requiresEndpoint: false,
523+
defaultEndpoint: 'https://api.minimax.io/v1',
524+
handler: {
525+
streamChat: (opts) => {
526+
const patchedSession = {
527+
...opts.session,
528+
apiEndpoint: opts.session.apiEndpoint || 'https://api.minimax.io/v1',
529+
}
530+
return streamOpenAiChat({ ...opts, session: patchedSession })
531+
},
532+
},
533+
},
513534
ollama: {
514535
id: 'ollama',
515536
name: 'Ollama',

src/lib/server/provider-health.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ describe('provider-health', () => {
129129
assert.ok(defaults.mistral)
130130
assert.ok(defaults.xai)
131131
assert.ok(defaults.fireworks)
132+
assert.ok(defaults.minimax)
132133
assert.ok(defaults.hermes)
133134
assert.ok(defaults.lmstudio)
134135

src/lib/server/provider-health.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ export const OPENAI_COMPATIBLE_DEFAULTS: Record<string, { name: string; defaultE
272272
fireworks: { name: 'Fireworks AI', defaultEndpoint: 'https://api.fireworks.ai/inference/v1' },
273273
nebius: { name: 'Nebius', defaultEndpoint: 'https://api.tokenfactory.nebius.com/v1' },
274274
deepinfra: { name: 'DeepInfra', defaultEndpoint: 'https://api.deepinfra.com/v1/openai' },
275+
minimax: { name: 'MiniMax', defaultEndpoint: 'https://api.minimax.io/v1' },
275276
hermes: { name: 'Hermes Agent', defaultEndpoint: 'http://127.0.0.1:8642/v1' },
276277
lmstudio: { name: 'LM Studio', defaultEndpoint: 'http://127.0.0.1:1234/v1' },
277278
}

src/lib/setup-defaults.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,18 @@ export const SETUP_PROVIDERS: SetupProviderOption[] = [
263263
icon: 'D',
264264
modelLibraryUrl: 'https://deepinfra.com/models',
265265
},
266+
{
267+
id: 'minimax',
268+
name: 'MiniMax',
269+
description: 'MiniMax M-series reasoning and multimodal models through an OpenAI-compatible API, with global and China regional endpoints.',
270+
requiresKey: true,
271+
supportsEndpoint: true,
272+
defaultEndpoint: 'https://api.minimax.io/v1',
273+
keyUrl: 'https://platform.minimax.io',
274+
keyLabel: 'platform.minimax.io',
275+
icon: 'M',
276+
modelLibraryUrl: 'https://platform.minimax.io/docs/api-reference/api-overview',
277+
},
266278
{
267279
id: 'ollama',
268280
name: 'Ollama',

src/types/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type ProviderType = 'claude-cli' | 'codex-cli' | 'opencode-cli' | 'opencode-web' | 'gemini-cli' | 'copilot-cli' | 'droid-cli' | 'cursor-cli' | 'qwen-code-cli' | 'goose' | 'aider-cli' | 'amp-cli' | 'augment-cli' | 'adal-cli' | 'bob-cli' | 'cline-cli' | 'codebuddy-cli' | 'command-code-cli' | 'continue-cli' | 'cortex-cli' | 'crush-cli' | 'deepagents-cli' | 'firebender-cli' | 'iflow-cli' | 'junie-cli' | 'kilo-code-cli' | 'kimi-cli' | 'kode-cli' | 'mcpjam-cli' | 'mistral-vibe-cli' | 'mux-cli' | 'neovate-cli' | 'openhands-cli' | 'pochi-cli' | 'qoder-cli' | 'replit-cli' | 'roo-code-cli' | 'trae-cn-cli' | 'warp-cli' | 'windsurf-cli' | 'zencoder-cli' | 'openai' | 'openrouter' | 'requesty' | 'tokenmix' | 'ollama' | 'anthropic' | 'openclaw' | 'hermes' | 'lmstudio' | 'google' | 'deepseek' | 'groq' | 'together' | 'mistral' | 'xai' | 'fireworks' | 'nebius' | 'deepinfra'
1+
export type ProviderType = 'claude-cli' | 'codex-cli' | 'opencode-cli' | 'opencode-web' | 'gemini-cli' | 'copilot-cli' | 'droid-cli' | 'cursor-cli' | 'qwen-code-cli' | 'goose' | 'aider-cli' | 'amp-cli' | 'augment-cli' | 'adal-cli' | 'bob-cli' | 'cline-cli' | 'codebuddy-cli' | 'command-code-cli' | 'continue-cli' | 'cortex-cli' | 'crush-cli' | 'deepagents-cli' | 'firebender-cli' | 'iflow-cli' | 'junie-cli' | 'kilo-code-cli' | 'kimi-cli' | 'kode-cli' | 'mcpjam-cli' | 'mistral-vibe-cli' | 'mux-cli' | 'neovate-cli' | 'openhands-cli' | 'pochi-cli' | 'qoder-cli' | 'replit-cli' | 'roo-code-cli' | 'trae-cn-cli' | 'warp-cli' | 'windsurf-cli' | 'zencoder-cli' | 'openai' | 'openrouter' | 'requesty' | 'tokenmix' | 'ollama' | 'anthropic' | 'openclaw' | 'hermes' | 'lmstudio' | 'google' | 'deepseek' | 'groq' | 'together' | 'mistral' | 'xai' | 'fireworks' | 'nebius' | 'deepinfra' | 'minimax'
22
export type ProviderId = ProviderType | (string & {})
33

44
export interface ProviderInfo {

0 commit comments

Comments
 (0)