xAI: Grok 4 Fast API

Access xAI: Grok 4 Fast from xAI using Puter.js AI API.

Get Started

Model Card

Grok 4 Fast is an optimized variant delivering performance similar to Grok 4 but using 40% fewer thinking tokens with a massive 2 million token context window. It offers up to 64x cost reduction versus early frontier models like OpenAI's o3.

Context Window

N/A

tokens

Max Output

30,000

tokens

Input Cost

$0.2

per million tokens

Output Cost

$0.5

per million tokens

API Usage Example

Add xAI: Grok 4 Fast to your app with just a few lines of code.
No API keys, no backend, no configuration required.

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat("Explain quantum computing in simple terms", {
            model: "x-ai/grok-4-fast"
        }).then(response => {
            document.body.innerHTML = response.message.content;
        });
    </script>
</body>
</html>

View full documentation →

Get started with Puter.js

Add xAI: Grok 4 Fast to your app without worrying about API keys or setup.

Read the Docs View Tutorials