Tutorials

Free, Unlimited Xiaomi MiMo API

On this page

In this tutorial, you will learn how to add Xiaomi MiMo models into your application for free using Puter.js. MiMo-V2-Flash is a Mixture-of-Experts model with 309B total parameters and 15B active parameters, featuring a 256K context window. It ranks #1 among open-source models on SWE-bench, excelling at reasoning, coding, and agent scenarios.

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.

Getting Started

Add Puter.js to your project with a single line:

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

That's it, you're ready to start integrating Xiaomi MiMo into your application.

Example 1: Code Generation

MiMo-V2-Flash ranks #1 on SWE-bench Verified, making it exceptional for code generation and software engineering tasks.
puter.ai.chat(
    "Write a TypeScript function that implements a rate limiter using the sliding window algorithm. Include type definitions and comments.",
    { model: "openrouter:xiaomi/mimo-v2-flash:free" }
)
.then(response => {
    puter.print(response);
});

Full code example:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "Write a TypeScript function that implements a rate limiter using the sliding window algorithm. Include type definitions and comments.",
            { model: "openrouter:xiaomi/mimo-v2-flash:free" }
        )
        .then(response => {
            puter.print(response);
        });
    </script>
</body>
</html>

Example 2: Complex Reasoning

MiMo excels at multi-step reasoning problems, breaking down complex logic into clear steps.
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamResponse() {
            const response = await puter.ai.chat(
                `A store sells apples in bags of 6 and oranges in bags of 4.
                If I buy exactly 3 bags total and end up with 16 fruits,
                how many bags of each did I buy? Show your reasoning step by step.`,
                { model: "openrouter:xiaomi/mimo-v2-flash:free", stream: true }
            );

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

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

Example 3: Agent-Style Task Planning

MiMo is designed for agent scenarios, making it excellent at breaking down complex tasks into actionable steps.
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamResponse() {
            const response = await puter.ai.chat(
                `You are a software architect. Plan the implementation of a user authentication system for a web app.
                Break it down into:
                1. Required components
                2. Step-by-step implementation order
                3. Security considerations
                4. Testing strategy`,
                { model: "openrouter:xiaomi/mimo-v2-flash:free", stream: true }
            );

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

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

List of Xiaomi MiMo models

You can use the following Xiaomi MiMo models with Puter.js:

openrouter:xiaomi/mimo-v2-flash:free

Conclusion

Using Puter.js, you can gain access to Xiaomi MiMo 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