Skip to main content
Kimi Code is Moonshot AI’s coding agent, available as a terminal CLI and a VS Code extension. It was built around the Kimi model family, which makes it a natural pairing with Kimi K3 on Together AI, Moonshot’s flagship open-weight model with a 1.05M-token context window. This guide shows you how to connect the Kimi Code CLI directly to the Together AI serverless endpoint for Kimi K3, so your agent runs on fast, secure infrastructure with your own Together AI API key. You can use this same approach to connect Kimi Code to any open-source model in the serverless catalog, like GLM 5.2 or Qwen3 Coder Next, and switch between them as you work.

1. Install Kimi Code

Install with the standalone installer:
Or install globally with npm (requires Node.js 22.19.0 or later):
Verify the installation:

2. Add Together AI as a provider

Kimi Code reads providers and models from ~/.kimi-code/config.toml. Add Together AI as an OpenAI-compatible provider, register Kimi K3 under it, and make it the default model:
~/.kimi-code/config.toml
Replace your_together_api_key with your actual Together AI API key. If the file already exists, keep any settings you have and add the default_model line, the [providers.together] table, and the [models."together/kimi-k3"] table alongside them. Validate the configuration:

3. Run Kimi Code

Launch the agent from your project directory:
Kimi Code starts its terminal UI with Kimi K3 on Together AI as the active model. Use /model inside the session to confirm the model or switch between any models you have configured. Kimi K3 thinks by default, and Kimi Code renders the reasoning trace as the agent works.

Alternative: configure with environment variables

For a quick test without touching config.toml, you can select the model entirely through the KIMI_MODEL_* environment variables. Kimi Code synthesizes a temporary provider from them for that session only:
Nothing persists after the session ends, so use the config.toml setup above for day-to-day work. That’s it! You now have Moonshot’s own coding agent running Kimi K3 on Together AI. See the Kimi K3 quickstart for model details and pricing, and the Kimi Code documentation for the agent’s full feature set.