Tutorials

Free, Unlimited Sakana AI API

On this page

In this tutorial, you will learn how to add Sakana AI's Fugu Ultra into your application for free using Puter.js. Fugu Ultra is a multi-agent orchestration system that routes tasks across a pool of frontier models, making it well suited for complex reasoning, code review, and agentic workflows.

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>

Nothing else is required to start using Puter.js for free access to Sakana AI's Fugu Ultra.

Example 1: Basic Text Generation with Fugu Ultra

To generate text use the puter.ai.chat() function:

puter.ai.chat("Explain why merge sort is O(n log n) and when you would choose it over quicksort.", { model: "sakana/fugu-ultra" })
    .then(response => {
        puter.print(response);
    });

Full code example:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat("Explain why merge sort is O(n log n) and when you would choose it over quicksort.", { model: "sakana/fugu-ultra" })
            .then(response => {
                puter.print(response);
            });
    </script>
</body>
</html>

Example 2: Streaming Responses

For longer responses, such as a step-by-step reasoning task, you can use streaming to get results in real-time:

<html>
<body>
    <div id="response"></div>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        async function streamResponse() {
            const outputDiv = document.getElementById('response');

            const response = await puter.ai.chat(
                "Walk through the steps to design a rate limiter for a public API, covering trade-offs at each decision.",
                {model: 'sakana/fugu-ultra', stream: true}
            );

            for await (const part of response) {
                if (part?.text) {
                    outputDiv.innerHTML += part.text;
                }
            }
        }

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

This example streams the response as it is generated, which gives a better experience for long, multi-step answers than waiting for the full response.

Available Models

The following Sakana AI model is supported by Puter.js:

sakana/fugu-ultra

Conclusion

You now have free access to Sakana AI's Fugu Ultra using Puter.js. This allows you to use frontier-level reasoning and agentic capabilities without needing API keys or backend infrastructure.

Free, Serverless AI and Cloud

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

Get Started Now

Read the Docs Try the Playground