Ten minutes from a blank workspace to a live model responding to real requests, monitored from the first call.
You need a Moon workspace and a machine that can run Node 20 or Python 3.11. If you signed up in the last hour you already have a workspace called Fieldwork. This guide uses the JavaScript SDK; the shape is identical in Python.
Pass a fallback array when you create the stream. Moon monitors live p95 latency per model and switches to the next entry when the leader crosses your budget.
await moon.chat.stream({ model: "claude-sonnet-5", fallback: ["claude-haiku-4-5"], budget_ms: 800 })
Each attempt is recorded in the trace with timing, so the fallback rate shows up in your Overview dashboard automatically
Add the client to your project. It has no runtime dependencies and works on Node, Deno, and Bun.
Once installed, authenticate with npx moon login. This opens a browser window and stores a machine-scoped token in your operating system keychain.