Ship a Full-Stack App with One Prompt

Copy this prompt into your AI coding agent, or open it in one below.

Give this to your AI Create a to-do list app using Puter.js

Coding manually? see the guide

Blog

Grok Image Generation Is Now Available in Puter.js

On this page

Puter.js now supports Grok-2-Image, xAI's text-to-image model. Generate visuals straight from the browser—no API keys or backend required.

What is Grok-2-Image?

Grok-2-Image turns prompts into high-quality images with low latency. In Puter.js, it returns a ready-to-use DOM Image element you can append, download, or send to a canvas.

Examples

Basic image generation

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.txt2img({
            prompt: "A cozy cabin at dusk in the snow, cinematic lighting",
            model: "grok-2-image",
            provider: "xai",
        }).then((image) => {
            document.body.appendChild(image);
        });
    </script>
</body>
</html>

Get Started Now

Add one script tag to your page:

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

Then call puter.ai.txt2img with model: "grok-2-image" and provider: "xai". Puter handles auth, rate limits, and retries—no keys or servers needed.

Learn more:

Ship a Full-Stack App with One Prompt

Give this to your AI Create a to-do list app using Puter.js

Coding manually? see the guide