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. The MiMo V2 family includes MiMo-V2-Flash for fast, cost-efficient coding, MiMo-V2-Pro for advanced reasoning and agentic workflows with a 1M-token context window, and MiMo-V2-Omni for multimodal understanding across text, image, video, and audio.

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

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>

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: "xiaomi/mimo-v2-flash" }
)
.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: "xiaomi/mimo-v2-flash" }
        )
        .then(response => {
            puter.print(response);
        });
    </script>
</body>
</html>

Example 2: Agentic Reasoning with MiMo-V2-Pro

MiMo-V2-Pro is optimized for agentic workflows with deep reasoning, tool calling, and task orchestration over a 1M-token context window.
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamResponse() {
            const response = await puter.ai.chat(
                `You are a senior backend engineer. I have a REST API with the following endpoints:
                - POST /users (create user)
                - GET /users/:id (get user)
                - PUT /users/:id (update user)
                - DELETE /users/:id (delete user)

                Design a comprehensive migration plan to convert this to GraphQL, including:
                1. Schema definitions with types, queries, and mutations
                2. A phased rollout strategy that maintains backward compatibility
                3. Resolver implementation patterns with DataLoader for N+1 prevention
                4. Testing and monitoring approach for each phase`,
                { model: "xiaomi/mimo-v2-pro", 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: Image Analysis with MiMo-V2-Omni

MiMo-V2-Omni natively processes text, image, video, and audio within a unified architecture, making it ideal for multimodal tasks.
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <img src="https://assets.puter.site/doge.jpeg" id="image">
    <script>
        puter.ai.chat(
            "What do you see in this image? Describe it in detail.",
            "https://assets.puter.site/doge.jpeg",
            { model: 'xiaomi/mimo-v2-omni' }
        ).then(response => {
            puter.print(response);
        });
    </script>
</body>
</html>

List of Xiaomi MiMo models

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

xiaomi/mimo-v2-flash
xiaomi/mimo-v2-omni
xiaomi/mimo-v2-pro

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