Chef Overflow: API Reference

Automate the kitchen. Top scores earn automatic admission to Hack the 6ix 2026.

← Back to Game KitchenAPI v2.0.0

Overview

Five chefs, one grid kitchen. Orders arrive at reception stands listing the ingredients and states required. Your code drives the chefs with KitchenAPI.command(chefId, stationId).

The first minute is playable by hand. After that, your code takes over. Three expired orders ends the run.

Quick Start

  1. Open index.html in a modern browser.
  2. Open DevTools (F12) and switch to the Console.
  3. Define a function and register it with KitchenAPI.run(fn).
  4. Click Start Game or call KitchenAPI.start().

API Reference

KitchenAPI.version

String. Current value: "2.0.0".

KitchenAPI.run(fn)

Registers fn to run once per frame. Signature: fn(state, api, tick) where state is a fresh getState() snapshot, api is KitchenAPI, tick is { dt, time }. Survives start() and restarts. Calling run() again replaces the previous function.

KitchenAPI.stop()

Unregisters the function set by run(). Does not stop the game.

KitchenAPI.plan(fn, opts)

Registers an async function that runs on its own cadence (default everyMs: 1000, clamped 100 to 60000). Signature: fn(state, api) → Promise<policy>. Its return value becomes state.policy and is returned by getPolicy(). Re-entrant calls are skipped. The last good policy is preserved on error.

KitchenAPI.unplan()

Unregisters the planner and clears state.policy.

KitchenAPI.getPolicy()

Returns the latest plan() output, or null.

KitchenAPI.start()

Starts or restarts the game. Resets stations, chefs, orders, and score. Clears raw event listeners. The function registered via run() survives.

KitchenAPI.togglePause()

Toggles the pause state. Syncs with the in-game Pause button.

KitchenAPI.command(chefId, stationId)

Routes the chef to a walkable tile next to the station and triggers the same interaction as a click. Returns { success, error? }. Chef IDs: 0 to 4. Station IDs: strings like 'bin_3', 'stove_0', 'reception_2'. See the Station ID Reference.

KitchenAPI.boost(chefId)

Brief movement speed boost with a cooldown. Same as pressing B.

KitchenAPI.selectChef(chefId)

UI selection only. Does not move the chef.

KitchenAPI.clearListeners()

Removes all event listeners registered via on() / onTick(). The run() function is re-attached automatically.

KitchenAPI.getState()

Returns a plain snapshot of the game state.

{ time, score, difficulty, phase, streak, bestStreak, rush: { active, timeLeft, cooldown }, failedOrders, maxFailedOrders, running, paused, gameOver, chefs: [{ id, name, pos: [x, y], holding: null | { ingredient, state } | { type: "plate", items }, busy, hasPath, boostActive, boostTime, boostCooldown, stall }], stations: { ingredientBins: [{ id, name, pos, ingredient }], stoves: [{ id, name, pos, cooking, cookTime, maxCookTime, ready, burnt }], cuttingBoards: [{ id, name, pos, busy, processing, processTime, maxProcessTime }], platingAreas: [{ id, name, pos, items }], receptionStands: [{ id, name, pos, order }], trashCans: [{ id, pos }], counters: [{ id, pos, items }] }, orders: [{ id, dish, timeLeft, standId, components }], upcomingOrders: [{ dish, components, etaSeconds }], policy, recipes }

KitchenAPI.getRecipes()

Returns an array of recipe metadata: { name, icon, difficulty, components }.

Events

Each registration returns an unsubscribe function: const off = KitchenAPI.onTick(fn); off();

MethodEventPayload
on(name, fn)genericvaries
onTick(fn)tick{ dt, time }
onOrderSpawned(fn)orderSpawned{ id, dish, timeLeft, standId, components }
onOrderExpired(fn)orderExpired{ id, dish, standId }
onOrderDelivered(fn)orderDelivered{ id, dish, score, streak }
onOrderFailed(fn)orderFailed{ dish }
onPhaseChanged(fn)phaseChanged{ phase }
onRushBurst(fn)rushBurst{ count }
onGameOver(fn)gameOver{ score, time, bestStreak }

Station ID Reference

StationID patternCount
Ingredient binbin_0 to bin_56
Stovestove_0 to stove_23
Cutting boardcutting_0, cutting_12
Plating areaplating_0 to plating_34
Trashtrash_01
Countercounter_0 to counter_N~15
Reception standreception_0 to reception_45

Recipes

DishComponents (ingredient, state)
Saladlettuce chopped, tomato chopped
Steakmeat cooked
Burgermeat cooked, dough raw
Pizzadough cooked, tomato chopped, cheese raw
Deluxe Burgermeat cooked, dough raw, onion chopped
Feast Plattermeat cooked, lettuce chopped, tomato chopped, cheese raw
Supreme Pizzadough cooked, tomato chopped, onion chopped, cheese raw

How each ingredient reaches its target state, and the order in which it joins the plate, is yours to discover.