Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/types/src/__tests__/provider-settings.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from "vitest"
import { getApiProtocol } from "../provider-settings.js"

describe("getApiProtocol", () => {
Expand Down Expand Up @@ -88,6 +89,17 @@ describe("getApiProtocol", () => {
})
})

describe("MiniMax provider", () => {
it("should return 'anthropic' for MiniMax M3 and M2.x models", () => {
expect(getApiProtocol("minimax", "MiniMax-M3-1M")).toBe("anthropic")
expect(getApiProtocol("minimax", "MiniMax-M3-512k")).toBe("anthropic")
expect(getApiProtocol("minimax", "MiniMax-M2.7")).toBe("anthropic")
expect(getApiProtocol("minimax", "MiniMax-M2.5")).toBe("anthropic")
expect(getApiProtocol("minimax", "MiniMax-M2")).toBe("anthropic")
expect(getApiProtocol("minimax")).toBe("anthropic")
})
})

describe("Edge cases", () => {
it("should return 'openai' when provider is undefined", () => {
expect(getApiProtocol(undefined)).toBe("openai")
Expand Down
40 changes: 39 additions & 1 deletion packages/types/src/providers/minimax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ModelInfo } from "../model.js"
// https://platform.minimax.io/docs/guides/pricing-paygo
// https://platform.minimax.io/docs/guides/pricing-tokenplan
export type MinimaxModelId = keyof typeof minimaxModels
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.7"
export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M3-1M"

export const minimaxModels = {
"MiniMax-M2.5": {
Expand Down Expand Up @@ -68,6 +68,44 @@ export const minimaxModels = {
description:
"MiniMax M2.7 highspeed: same performance as M2.7 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M3-512k": {
maxTokens: 65_536,
contextWindow: 524_288,
supportsImages: true,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.3,
outputPrice: 1.2,
// M3 routes through the Anthropic Messages path on api.minimax.io/anthropic
// with client-side cache_control injection active, so cache_creation_input_tokens
// are reported and billed. Matches the MiniMax write price shared by the M2
// family (same vendor/pricing tier: $0.3 in / $1.2 out / $0.06 cache read).
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.06,
description:
"MiniMax M3 (512K context) — the latest MiniMax model with multimodal input, stronger agentic reasoning and tool use, exposed via a 512K-token context window. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M3-1M": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
includedTools: ["search_and_replace"],
excludedTools: ["apply_diff"],
preserveReasoning: true,
inputPrice: 0.3,
outputPrice: 1.2,
// M3 routes through the Anthropic Messages path on api.minimax.io/anthropic
// with client-side cache_control injection active, so cache_creation_input_tokens
// are reported and billed. Matches the MiniMax write price shared by the M2
// family (same vendor/pricing tier: $0.3 in / $1.2 out / $0.06 cache read).
cacheWritesPrice: 0.375,
cacheReadsPrice: 0.06,
description:
"MiniMax M3 (1M context) — the latest MiniMax model with multimodal input, stronger agentic reasoning and tool use, exposed via a 1M-token context window. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.",
},
"MiniMax-M2": {
maxTokens: 16_384,
contextWindow: 204_800,
Expand Down
Loading
Loading