# MiniMax-M2.1 > MiniMax's text model optimized for code generation and refactoring across many programming languages. ## Key facts - Model author: MiniMax - Input: $0.30 per 1M tokens - Output: $1.20 per 1M tokens - Cached input: $0.03 per 1M tokens - Context window: 204,800 tokens - Input modalities: text - Output modalities: text - Capabilities: reasoning, tools - Released: 2025-12-23 - Model IDs: `minimax/MiniMax-M2.1` - Model page: https://www.realrelay.ai/model/minimax/minimax-m2.1 ## Overview MiniMax-M2.1 is a text model from MiniMax optimized for code generation and refactoring. MiniMax's documentation highlights multi-language programming, precise code refactoring and enhanced reasoning. It supports reasoning and tool calling, takes text input, returns text, and was released on December 23, 2025. It has a 204,800-token context window. It accepts text input and returns text. It was released on December 23, 2025. ## Capabilities Reasoning and tool calling are the supported capabilities. In a coding setting that means the model can think through a refactor, call tools to read or run code, and return the changes as text. Input is text only, which fits source code, error logs, diffs and written instructions. Cached input reads are billed at a reduced rate, which helps when the same repository context is sent repeatedly. ## Pricing MiniMax-M2.1 is priced at $0.30 per 1M input tokens and $1.20 per 1M output tokens. Cached input reads cost $0.03 per 1M tokens. MiniMax-M2.1 is available through RealRelay's OpenAI-compatible API. ## Use cases Use MiniMax-M2.1 for code generation across many languages, such as writing functions, tests and scripts from a written description. It is also suited to refactoring work: send a module and ask for a cleaner structure, and the model can reason about the change and call tools to apply and check it. ## Call it OpenAI-compatible chat completions: ```bash curl https://www.realrelay.ai/v1/chat/completions \ -H "Authorization: Bearer $REALRELAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "minimax/MiniMax-M2.1", "messages": [{"role": "user", "content": "Hello"}]}' ``` ## FAQ ### What is MiniMax-M2.1? MiniMax-M2.1 is a text model from MiniMax optimized for code generation and refactoring. MiniMax's documentation highlights multi-language programming, precise code refactoring and enhanced reasoning. It supports reasoning and tool calling, takes text input, returns text, and was released on December 23, 2025. ### How much does MiniMax-M2.1 cost? MiniMax-M2.1 is priced at $0.30 per 1M input tokens and $1.20 per 1M output tokens. Cached input reads cost $0.03 per 1M tokens. ### What is the context window of MiniMax-M2.1? MiniMax-M2.1 has a 204,800-token context window. ### What inputs and outputs does MiniMax-M2.1 support? MiniMax-M2.1 accepts text input and returns text. ### Is MiniMax-M2.1 good for coding? MiniMax-M2.1 is optimized by MiniMax for code generation and refactoring, with multi-language programming, reasoning and tool calling. ### When was MiniMax-M2.1 released? MiniMax-M2.1 was released on December 23, 2025. ### How do I call MiniMax-M2.1 through the API? Call MiniMax-M2.1 through RealRelay's OpenAI-compatible API by setting the model field to minimax/MiniMax-M2.1.