
This tutorial shows how to call Google's new Gemini 4 Argon model (model ID "gemini-4-argon") from Node.js using the official @google/genai SDK, moving from a basic hello-world call to controlling the model's thinking_level (low vs high), holding a multi-turn conversation via previous_interaction_id, and finally using background mode to have the model build a playable Breakout game in a single HTML file. It requires a Google account, an API key from Google AI Studio tied to a billing-enabled project, Node.js with "type": "module" set in package.json, and a .env file storing the key as GEMINI_API_KEY. The video ends with a working game.html Breakout game generated from one background prompt, plus a short on-camera segment with Google DeepMind's Jack Wetherspoon and a teammate discussing the model.
Goal [00:02]: Google released Gemini 4 Argon, described as Google's most capable model yet, built for complex coding, math, and science tasks.
![Step [01:36]: the context window is described as the model's working memory covering everything it can see and hold at o](assets/JGly6PSK5iw/frame_98.jpg)
![Step [06:31]: using background mode, Argon is asked to build a playable Breakout game in a single HTML file with inline](assets/JGly6PSK5iw/frame_397.jpg)
![Config [06:48]: background is set to true, thinking_level set to "high", and max_output_tokens raised to 131,072.](assets/JGly6PSK5iw/frame_407.jpg)
import { writeFile } from "node:fs/promises";
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
let interaction = await client.interactions.create({
model: "gemini-4-argon",
input:
"Build a playable Breakout game in a single HTML file," +
"with the CSS and JavaScript inline. " +
"Include a score, three lives, and a restart button." +
"Reply with only the HTML.",
background: true,
generation_config: {
max_output_tokens: 131072,
thinking_level: "high",
},
});
console.log("Started:", interaction.id);
while (interaction.status === "in_progress" [...] interaction.status === "queued") {
await new Promise((resolve) => setTimeout(resolve, 50o0));
interaction = await client.interactions.get(interaction.id);
console.log("status:", interaction.status);
}
const text = interaction.steps
.filter((step) => step.type === "model_output")
.flatMap((step) => step.content ?? [])
.filter((content) => content.type === "text")
.map((content) => content.text)
.join("");
const html = text.replace(/^[...](?:html)?\s*/i, "").replace(/[...]\s*$/, "");
await writeFile("game.html", html);
console.log("Saved game.html. Usage:", interaction.usage);Find the bug in this code and give me the fixed version:
${buggyCode}Great. Now what should happen if the array is empty? Update the function to handle that.
Explain what an API is to someone writing their first line of code. Keep it to three sent[...]
import { GoogleGenAI } from "@google/genai";
import { buggyCode } from "./buggy-code.js";
const client = new GoogleGenAI({});
async function hunt(level) {
const start = Date.now();
const interaction = await client.interactions.create({
model: "gemini-4-argon",
input: `Find the bug in this code and explain it in one short paragraph:\n${[...]}`,
generation_config: {
thinking_level: level,
},
});
const seconds = ((Date.now() - start) / 1000).toFixed(1);
console.log(`\n--- thinking_level: ${level} (${seconds}s) ---`);
console.log("Thinking tokens:", interaction.usage?.total_thought_tokens);
console.log(interaction.output_text);
}
await hunt("low");
await hunt("high");Transcript lays out a goal and step by step plan (API key, npm init, SDK install, env file, thinking levels, chat, build a game) and OCR shows a code editor with buggy-code.js, think.js, chat.js plus terminal output walking through an off-by-one bug fix, matching a coding tutorial replicate-the-result shape.
The lens sets this brief's structure, never its facts — every claim is held to the same citation and fact-check standard.