Grok Build 0.1 Is Now Available in Puter.js
On this page
Puter.js now supports Grok Build 0.1, xAI's fast coding model trained specifically for agentic software engineering workflows. It's purpose-built for interactive coding agents, tool use, and multi-step development tasks rather than general-purpose conversation.
What is Grok Build 0.1?
Grok Build 0.1 is the model that powers xAI's Grok Build CLI, an agentic command-line tool that can plan projects, write and edit files, execute shell commands, and build complete applications from natural language prompts. It accepts text and image inputs and supports a 256K token context window with built-in reasoning that is always active.
Key highlights:
- 256K Token Context — large enough to fit entire repositories, long traces, or multi-file diffs in a single request
- Always-On Reasoning — built-in step-by-step thinking before responding, tuned for code planning and multi-step execution
- Agentic By Design — trained for tool calling, structured outputs, and long-horizon workflows where the model edits files, runs commands, and recovers from failures
- Multimodal Input — accepts images alongside text, useful for screenshots, design mocks, and diagrams
- Accessible Pricing — $1 per million input tokens and $2 per million output tokens, well below most frontier coding models
Examples
Code generation
puter.ai.chat(
"Write a Python function that implements a thread-safe LRU cache with a configurable max size",
{ model: 'x-ai/grok-build-0.1' }
);
Bug fixing
puter.ai.chat(`Fix this code that should reverse a linked list but doesn't work:
def reverse(head):
prev = None
while head:
head.next = prev
prev = head
head = head.next
return prev`,
{ model: 'x-ai/grok-build-0.1' }
);
Code refactoring
puter.ai.chat(
"Refactor this class to use the repository pattern:\n\nclass UserService {\n getUser(id) { return db.query('SELECT * FROM users WHERE id = ?', [id]); }\n saveUser(user) { return db.query('INSERT INTO users VALUES (?)', [user]); }\n}",
{ model: 'x-ai/grok-build-0.1' }
);
Tool calling
function runShell(command) {
const mockOutputs = {
'ls': 'package.json\nsrc\nREADME.md',
'pwd': '/home/user/project',
};
return mockOutputs[command] || 'command not found';
}
const tools = [{
type: "function",
function: {
name: "run_shell",
description: "Run a shell command and return its stdout",
parameters: {
type: "object",
function runShell(command) {
const mockOutputs = {
'ls': 'package.json\nsrc\nREADME.md',
'pwd': '/home/user/project',
};
return mockOutputs[command] || 'command not found';
}
const tools = [{
type: "function",
function: {
name: "run_shell",
description: "Run a shell command and return its stdout",
parameters: {
type: "object",function runShell(command) {
const mockOutputs = {
'ls': 'package.json\nsrc\nREADME.md',
'pwd': '/home/user/project',
};
return mockOutputs[command] || 'command not found';
}
const tools = [{
type: "function",
function: {
name: "run_shell",
description: "Run a shell command and return its stdout",
parameters: {
type: "object",
properties: {
command: {
type: "string",
description: "The shell command to execute"
}
},
required: ["command"]
}
}
}];
const userInput = "What files are in the current directory?";
const completion = await puter.ai.chat(userInput, {
model: 'x-ai/grok-build-0.1',
tools,
});
if (completion.message.tool_calls?.length > 0) {
const toolCall = completion.message.tool_calls[0];
const args = JSON.parse(toolCall.function.arguments);
const output = runShell(args.command);
const finalResponse = await puter.ai.chat([
{ role: "user", content: userInput },
completion.message,
{
role: "tool",
tool_call_id: toolCall.id,
content: output
}
], { model: 'x-ai/grok-build-0.1' });
console.log(finalResponse);
}
Screenshot to code
puter.ai.chat(
"Generate the HTML and CSS needed to recreate the UI shown in this screenshot",
"https://assets.puter.site/example-ui.png",
{ model: 'x-ai/grok-build-0.1' }
);
Get Started Now
Just add one library to your project:
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
Or add one script tag to your HTML:
<script src="https://js.puter.com/v2/"></script>
No API keys and no infrastructure setup. Start building with Grok Build 0.1 immediately.
Learn more:
Free, Serverless AI and Cloud
Start creating powerful web applications with Puter.js in seconds!
Get Started Now