Frontier coding models are becoming more capable, but using them for every task can become expensive quickly.
That matters when an AI agent is part of your daily development workflow.
The answer is not to use a cheaper model blindly. It is to match the model to the task. A strong open-weight model can handle repository exploration, test writing, documentation, contained refactors, and many routine implementation tasks. Save premium models and extra review for the work where the stakes or ambiguity truly justify them.
In this tutorial, you will use Kimi K3 with Claude Code through Nebius Token Factory Relay. The relay lets Claude Code communicate with Nebius-hosted open models without changing the workflow you use in the terminal.
For a visual walkthrough, watch the accompanying video:
What You Will Learn
By the end of this tutorial, you will be able to:
- Explain what Kimi K3 is and when it makes sense to use it.
- Create a Nebius Token Factory API key.
- Install and configure Nebius TF Relay.
- Launch Claude Code with Kimi K3.
- Confirm that the model is working before you give it a real coding task.
What Is Kimi K3?
Kimi K3 is Moonshot AI’s flagship open-weight model. It is built for coding, agentic workflows, long-context tasks, and knowledge work. The model uses a Mixture-of-Experts architecture with 2.8 trillion total parameters and 104 billion active parameters per token. Moonshot reports a one-million-token context window and native vision capabilities in its technical report.
The model has attracted attention because it performs competitively on coding and agentic benchmarks while being available as open weights. Independent testing from Artificial Analysis places it close to leading proprietary models on agentic knowledge work. Moonshot’s own evaluation suite reports strong results across coding, agentic, long-context, and multimodal evaluations.
Benchmarks are useful context, but they are not a guarantee for your project. They use fixed prompts, tools, and scoring systems. The practical question is whether the model gives you reliable output on your codebase at an acceptable cost and speed.
Kimi K3 is a good model to try for:
- Understanding an unfamiliar codebase
- Writing or improving tests
- Refactoring a well-defined area of a project
- Drafting documentation and technical notes
- Investigating an error before making a change
For sensitive security work, complex migrations, high-impact architecture decisions, or production changes, use the model and review process that give you the highest confidence.
Note: Kimi K3’s published model context window is one million tokens. Nebius TF Relay currently lists a 262K context window for its Kimi K3 route. The provider you use determines the limits, pricing, availability, and performance you actually receive.
How Nebius TF Relay Works
Claude Code is designed to communicate with Anthropic’s Messages API. Nebius Token Factory provides hosted open models through an OpenAI-compatible API. Those two APIs do not speak the same format.
Nebius TF Relay runs locally and translates between them. Claude Code sends requests to the relay, the relay converts them for Nebius, and the response is converted back for Claude Code. This means you can keep using the terminal interface, repository tools, and approval flow you already know.
The setup looks like this:
| Component | Role |
|---|---|
| Claude Code | Your coding-agent interface |
| Nebius TF Relay | Local protocol bridge |
| Nebius Token Factory | Hosted inference provider |
| Kimi K3 | The model that generates responses |
Prerequisites
Before you begin, make sure you have the following:
- Claude Code installed locally. Use the official installation guide if needed.
- A Nebius Token Factory account.
- A terminal on macOS, Linux, or WSL.
- An optional Tavily API key if you want web search inside the relay.
You will also need a Nebius Token Factory API key. Create one from the Nebius API-key page. Copy it to a secure location when it is created.
Do not commit the key to Git, paste it into an AI prompt, or show it in a video recording.
Step 1: Install Nebius TF Relay
Install the relay with the project’s installer:
curl -fsSL https://nebius-tf-relay.vercel.app/install.sh | sh
This installs the nebiusrelay command and shortcuts such as nclaude.
If you work in a company or security-sensitive environment, inspect the project source before running a shell installer from the internet. That is good practice for any third-party developer tool.
After installation, check that the command is available:
nebiusrelay
You should see the relay’s interactive menu.
Step 2: Configure Your Nebius API Key
Run the configuration command:
nebiusrelay configure
When prompted, paste your Nebius Token Factory API key. The setup will also ask for a Tavily API key. You can skip this if you do not need web search.
The relay stores its configuration locally. You can also supply the key through an environment variable instead:
export NEBIUS_API_KEY="your_nebius_api_key"
Using an environment variable is useful for temporary sessions and automated environments. On a shared machine, use a secret manager or another protected credential workflow so that the key is not exposed in shell history.
Step 3: Launch Claude Code Through the Relay
Move into the repository where you want to work, then run:
nebiusrelay claude
You can use the shorter alias as well:
nclaude
The relay starts Claude Code with the Nebius endpoint and credentials configured for that session. It does not require you to permanently replace your existing Claude Code settings.
If Claude Code is not installed, the relay will tell you and point you to the official installation path.
Step 4: Select Kimi K3
Once Claude Code opens, use the model selector:
/model
Select Kimi K3 from the list.
Nebius TF Relay fetches the available model catalog when it starts, so the exact choices can change over time. Kimi K3 is documented as the relay’s default coding model, but it is worth checking the selected model before you begin a session.
Step 5: Verify the Setup With a Safe Prompt
Before asking the agent to change code, start with a read-only task. This confirms that the relay, credentials, model selection, and repository access are all working.
Use this prompt:
Read this repository without changing files. Identify the application entry point,
the test command, and the three highest-risk areas to modify. Cite the files you used.
This is a better first test than a vague request such as “build a feature.” It gives you evidence that the model can inspect the repository and follow constraints without making changes.
After that succeeds, try a small, bounded task. For example:
Inspect the failing test. Do not edit files yet. Explain the likely root cause,
the minimum fix, and the tests you would run after the change.
Review the proposal before you approve edits. Then inspect the diff and run the relevant tests yourself.
Key Takeaways
- Kimi K3 is a capable open-weight model for coding, agentic work, and long-context tasks.
- Nebius TF Relay lets you access it inside Claude Code without changing your normal terminal workflow.
- You need a Nebius Token Factory API key, the relay, and the
nclaudecommand to get started. - Start with a read-only prompt, then validate every code change with a diff review and tests.
- Use the model that best matches the risk and complexity of the task—not necessarily the most expensive one.
Kimi K3 with Claude Code is not a replacement for engineering judgment. It is a practical way to add another strong model to your workflow and reserve expensive frontier-model usage for the situations where it has the most value.





Top comments (0)