Tutorials

Free, Unlimited Qwen API

On this page

This tutorial will show you how to use Puter.js to access all Qwen family models—from general chat to instruction‑tuned, vision and code models—completely free, without any API keys or usage restrictions.

Puter is the pioneer of the "User-Pays" model, which allows developers to incorporate AI capabilities into their applications while each user will cover their own usage costs. This model enables developers to access advanced AI capabilities for free, without any API keys or server-side setup.

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>

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

Example 1: Use Qwen3.5 for conversational AI

To generate text using Qwen3.5 397B A17B, use the puter.ai.chat() function:

puter.ai.chat("Tell me a fun trivia fact about space.", { model: "qwen/qwen3.5-397b-a17b" })
    .then(response => {
        puter.print(response);
    });

Full code example:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat("Tell me a fun trivia fact about space.", { model: "qwen/qwen3.5-397b-a17b" })
            .then(response => {
                puter.print(response);
            });
    </script>
</body>
</html>

Example 2: Write code with qwen3-coder-next

To write code using Qwen3 Coder Next, use the puter.ai.chat() function:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(
            "Write a simple JavaScript function that calculates the sum of two numbers.",
            { model: "qwen/qwen3-coder-next" }
        )
        .then(response => {
            puter.print(response, {code: true});
        });
    </script>
</body>
</html>

Example 3: Complex Reasoning

For complex reasoning, use Qwen3 Max Thinking with streaming to get results in real-time:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamResponse() {
            const response = await puter.ai.chat(
                "Explain quantum computing in detail", 
                { model: "qwen/qwen3-max-thinking", 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 4: Image Analysis

To analyze images, simply provide an image URL to puter.ai.chat():

<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: 'qwen/qwen3.5-397b-a17b' }
        ).then(response => {
            document.write(response);
        });
    </script>
</body>
</html>

List of supported models

The following Qwen models are supported by Puter.js:

qwen/qwen3.5-9b
qwen/qwen3.5-122b-a10b
qwen/qwen3.5-27b
qwen/qwen3.5-35b-a3b
qwen/qwen3.5-flash-02-23
qwen/qwen3.5-397b-a17b
qwen/qwen3.5-plus-02-15
qwen/qwen3-max-thinking
qwen/qwen3-coder-next
qwen/qwen3-next-80b-a3b-instruct
qwen/qwen3-next-80b-a3b-thinking
qwen/qwen-plus-2025-07-28
qwen/qwen-plus-2025-07-28:thinking
qwen/qwen3-235b-a22b-2507
qwen/qwen3-235b-a22b-thinking-2507
Show 34 more lines...
qwen/qwen3.5-9b
qwen/qwen3.5-122b-a10b
qwen/qwen3.5-27b
qwen/qwen3.5-35b-a3b
qwen/qwen3.5-flash-02-23
qwen/qwen3.5-397b-a17b
qwen/qwen3.5-plus-02-15
qwen/qwen3-max-thinking
qwen/qwen3-coder-next
qwen/qwen3-next-80b-a3b-instruct
qwen/qwen3-next-80b-a3b-thinking
qwen/qwen-plus-2025-07-28
qwen/qwen-plus-2025-07-28:thinking
qwen/qwen3-235b-a22b-2507
qwen/qwen3-235b-a22b-thinking-2507
qwen/qwen3-30b-a3b-instruct-2507
qwen/qwen3-30b-a3b-thinking-2507
qwen/qwen3-coder
qwen/qwen3-coder-30b-a3b-instruct
qwen/qwen3-coder-flash
qwen/qwen3-coder-plus
qwen/qwen3-vl-235b-a22b-instruct
qwen/qwen3-vl-235b-a22b-thinking
qwen/qwen3-vl-30b-a3b-instruct
qwen/qwen3-vl-30b-a3b-thinking
qwen/qwen3-vl-32b-instruct
qwen/qwen3-vl-8b-instruct
qwen/qwen3-vl-8b-thinking
qwen/qwen3-max
qwen/qwen3-14b
qwen/qwen3-235b-a22b
qwen/qwen3-30b-a3b
qwen/qwen3-32b
qwen/qwen3-4b:free
qwen/qwen3-8b
qwen/qwen2.5-vl-32b-instruct
qwen/qwq-32b
qwen/qwen-max
qwen/qwen-plus
qwen/qwen-turbo
qwen/qwen-2.5-vl-7b-instruct
qwen/qwen-vl-max
qwen/qwen-vl-plus
qwen/qwen2.5-vl-72b-instruct
qwen/qwen-image
qwen/qwen-2.5-coder-32b-instruct
qwen/qwen-2.5-72b-instruct
qwen/qwen-2.5-7b-instruct
qwen/qwen2.5-coder-7b-instruct
Collapse code

Conclusion

Using Puter.js, you can access Qwen model capabilities without needing an API key or a backend. 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