Tutorials

Free, Unlimited MiniMax API

On this page

This tutorial will show you how to use Puter.js to access MiniMax models, including MiniMax M2.5, MiniMax M2.1, MiniMax M2-her, MiniMax M2, MiniMax M1, and MiniMax 01 completely free, without any API keys.

Puter.js uses the User-Pays model, where users of your application cover their own AI costs. This means you as a developer don't pay anything for your users' usage, making your app practically free to run. You can scale to unlimited users and pay nothing for the AI or server usage.

To use Puter.js, import our NPM library in your project:

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

Or alternatively, add our script via CDN if you are working directly with HTML, simply add it to the <head> or <body> section of your code:

<script src="https://js.puter.com/v2/"></script>

Nothing else is required to start using Puter.js for free access to MiniMax models and capabilities.

Code with MiniMax M2.5

MiniMax M2.5 is the state-of-the-art model from MiniMax, scoring 80.2% on SWE-Bench Verified and 76.8% on BFCL Multi-Turn. It excels at agentic coding, tool use, and real-world software engineering tasks.

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "Review this code and refactor it into a production-ready Express middleware with proper error handling, input validation, and TypeScript types:\n\napp.post('/users', (req, res) => { db.query('INSERT INTO users SET ?', req.body, (err, result) => { res.json(result) }) })",
            { model: "minimax/minimax-m2.5" }
        )
        .then(response => {
            puter.print(response, {code: true});
        });
    </script>
</body>
</html>

Code with MiniMax M2.1

MiniMax M2.1 is an enhanced version of M2. It matches or exceeds Claude Sonnet 4.5 on coding benchmarks.

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "Write a TypeScript function that debounces async API calls with abort controller support and a configurable timeout",
            { model: "minimax/minimax-m2.1" }
        )
        .then(response => {
            puter.print(response, {code: true});
        });
    </script>
</body>
</html>

Chat with MiniMax M2-her

MiniMax M2-her is optimized for dialogue. It excels in immersive roleplay, multi-turn conversations, and storytelling.

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "You are a wise wizard named Merlin. Greet a young apprentice.",
            { model: "minimax/minimax-m2-her" }
        )
        .then(response => {
            puter.print(response);
        });
    </script>
</body>
</html>

Code with MiniMax M2

MiniMax M2 excels in code generation tasks. Here's how to use it for writing code:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "Write a Python function that implements a binary search tree with insert and search methods",
            { model: "minimax/minimax-m2" }
        )
        .then(response => {
            puter.print(response, {code: true});
        });
    </script>
</body>
</html>

Code with MiniMax M1

MiniMax M1 is optimized for handling long contexts. Use streaming for better performance with longer inputs:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamLongContext() {
            const response = await puter.ai.chat(
                "Explain the history of artificial intelligence in detail, covering its origins, major milestones, key figures, and future prospects",
                { model: "minimax/minimax-m1", stream: true }
            );

            for await (const part of response) {
                puter.print(part?.text);
            }
        }

        streamLongContext();
    </script>
</body>
</html>

Image analysis with MiniMax-01

MiniMax-01 supports multimodal inputs. You can use it for text generation or image analysis:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "What do you see in this image?",
            "https://assets.puter.site/doge.jpeg",
            { model: 'minimax/minimax-01' }
        ).then(response => {
            puter.print(response);
        });
    </script>
</body>
</html>

List of Models

The following MiniMax models are supported by Puter.js:

minimax/minimax-m2.5
minimax/minimax-m2.1
minimax/minimax-m2-her
minimax/minimax-m2
minimax/minimax-m1
minimax/minimax-01

Conclusion

Using Puter.js, you can gain access to MiniMax models without having to set up the AI server yourself. And thanks to the User-Pays model, your users cover their own AI usage, not you as the developer. This means you can build powerful applications without worrying about AI usage costs.

You can find all AI features supported by Puter.js in the documentation.

Free, Serverless AI and Cloud

Start creating powerful web applications with Puter.js in seconds!

Get Started Now

Read the Docs Try the Playground