TUTORIAL
How to run Kimi K3 with Grok Build
Use xAI's Grok Build terminal harness with Moonshot AI's Kimi K3 on Nebius Token Factory. No xAI API key needed, and your Nebius key never reaches api.x.ai.
Grok Build is xAI's terminal coding harness. Nebius does not serve Grok models, so NConnect runs the harness on Nebius models instead: you get Grok Build's interface driving Kimi K3, Moonshot AI's frontier open-weights model with a 1,048,576-token context window.
Prerequisites
- macOS or Linux.
- A Nebius Token Factory API key from tokenfactory.nebius.com.
- No xAI account or API key.
Steps
Install NConnect
This installs the CLI and the
ngrokalias, plus Bun if needed.curl -fsSL https://nconnect.sh/install.sh | bashAdd your Nebius API key
nconnect configureInstall Grok Build
Skip this if
grokis already on your PATH. In an interactive terminal, NConnect also offers to run this for you the first time you launch Grok Build.curl -fsSL https://x.ai/cli/install.sh | bashLaunch Grok Build on Kimi K3
nconnect --model moonshotai/Kimi-K3 grokYou should see NConnect ▸ Launching Grok Build with Nebius Token Factory (Kimi K3). Not xAI.
What NConnect does on launch
- Serves the Nebius model catalog to Grok Build from a temporary localhost endpoint, so every Nebius model appears in Grok's model picker as
Nebius · Kimi K3and so on. - Uses an isolated, empty auth file. Your normal Grok login is ignored for the session and left untouched.
- Points every xAI-native endpoint at the localhost server and turns off image generation, image editing and voice, which call api.x.ai directly. Your Nebius key can never be sent to xAI.
- Adds a system rule so the model identifies itself as Kimi K3 on Nebius rather than claiming to be Grok.
Add your own rules
--rules and --append-system-prompt still work. NConnect merges them with its identity rule:
nconnect --model moonshotai/Kimi-K3 grok --rules "Prefer small, reviewable diffs."Track cost and add fallback
Grok Build is a spawned harness, so by default it calls Nebius directly and NConnect reports $0.00. Route it through the daemon to meter every turn and get automatic fallback if Kimi K3 is busy:
NCONNECT_METER=1 nconnect --model moonshotai/Kimi-K3 grokThen check spend with nconnect usage --last 7d. See Cost metering.
