MiniMax Integration
MiniMax is a Chinese AI company offering high-performance LLMs via an OpenAI-compatible API.
Embabel integrates MiniMax as a first-class provider using the same OpenAiCompatibleModelFactory pattern as other OpenAI-compatible providers.
Add the Dependency
<dependency>
<groupId>com.embabel.agent</groupId>
<artifactId>embabel-agent-starter-minimax</artifactId>
</dependency>
API Key Configuration
Set your MiniMax API key via environment variable (recommended) or Spring property:
export MINIMAX_API_KEY=your-api-key
Or in application.yml:
embabel:
agent:
platform:
models:
minimax:
api-key: your-api-key
The environment variable MINIMAX_API_KEY takes precedence over the property value.
Use the property for local development and the environment variable in production deployments.
Available Models
| Model Name | Model ID | Context Window | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|---|---|
MiniMax-M2.7 | MiniMax-M2.7 | 1M tokens | $1.10 | $4.40 |
MiniMax-M2.7-highspeed | MiniMax-M2.7-highspeed | 1M tokens | $0.55 | $2.20 |
MiniMax-M2.7 is the flagship model, optimized for quality.
MiniMax-M2.7-highspeed trades some quality for significantly lower latency and cost — a good choice for intermediate steps in a multi-action agent flow.
Embabel’s per-step LLM selection makes MiniMax models particularly well-suited to mixed strategies: use MiniMax-M2.7-highspeed for extraction and classification steps, and reserve MiniMax-M2.7 (or a premium model) only for the final reasoning step.
Using MiniMax Models
Reference models by name in @LlmCall or programmatically via ai.withLlm():
// Declarative
@LlmCall(llm = "MiniMax-M2.7")
fun summarize(article: Article): Summary
// Programmatic
ai.withLlm("MiniMax-M2.7-highspeed")
.create<Classification>("Classify this input")
Or map MiniMax models to roles in your configuration:
embabel:
models:
llms:
cheapest: MiniMax-M2.7-highspeed
best: MiniMax-M2.7
Then reference by role with the # prefix:
@LlmCall(llm = "#cheapest")
fun extractEntities(text: String): EntityList
Temperature Clamping
MiniMax models require temperature in the range (0.0, 1.0] — a value of exactly 0.0 is not permitted.
Embabel’s MiniMaxOptionsConverter clamps temperature automatically:
- Values
<= 0.0are raised to0.01 - Values
> 1.0are lowered to1.0
A DEBUG log message is emitted whenever clamping occurs.
No action is required on your part — this is handled transparently.
Configuration Reference
embabel:
agent:
platform:
models:
minimax:
api-key: your-api-key # Alternative to MINIMAX_API_KEY env var
base-url: https://api.minimax.io/v1 # Default; override for proxies
max-attempts: 4 # Retry attempts (default: 4)
backoff-millis: 1500 # Initial backoff ms (default: 1500)
backoff-multiplier: 2.0 # Backoff multiplier (default: 2.0)
backoff-max-interval: 60000 # Max backoff ms (default: 60000)




