Skip to content

Command-line agents

Kimi Code

Add NoviaHub to Kimi Code CLI's config.toml as an OpenAI-compatible provider.

Kimi Code CLI is Moonshot AI’s terminal AI agent. In its own words, it runs in the terminal and helps with software development and everyday terminal work: reading and modifying code, running shell commands, searching files, fetching web pages, and planning its next steps based on feedback. It is written in TypeScript and distributed via npm.

The install script is the recommended method and doesn’t need Node.js installed first:

终端窗口
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

In Kimi Code CLI, a “provider” decides which protocol to use and where to connect; a “model” is an alias defined on top of a provider. The steps below add NoviaHub as a provider that uses the OpenAI Chat Completions protocol.

  1. Store the key in the environment variable NOVIAHUB_API_KEY.

    终端窗口
    # macOS uses zsh by default; with bash on Linux, use ~/.bashrc instead of ~/.zshrc
    echo 'export NOVIAHUB_API_KEY="sk-..."' >> ~/.zshrc
    source ~/.zshrc
  2. Edit the config file ~/.kimi-code/config.toml. It is created automatically the first time you run kimi; if it isn’t there, create it. Add:

    ~/.kimi-code/config.toml
    default_model = "noviahub/deepseek-v4-flash"
    [providers.noviahub]
    type = "openai"
    base_url = "https://noviahub.com/v1"
    api_key_env = "NOVIAHUB_API_KEY"
    [models."noviahub/deepseek-v4-flash"]
    provider = "noviahub"
    model = "deepseek-v4-flash"
    max_context_size = 1000000
    Setting Purpose
    default_model The model alias new sessions use. It must be defined in a [models."..."] table below. If the file already has a default_model, change its value instead of adding a second line.
    type The protocol. openai means OpenAI Chat Completions.
    base_url The API address, including /v1: https://noviahub.com/v1.
    api_key_env Which environment variable to read the key from. It is read again on every request.
    [models."noviahub/deepseek-v4-flash"] The model alias. The name contains /, so it must be quoted.
    provider Which provider to use; matches [providers.noviahub] above.
    model The model ID sent to NoviaHub. It must match the model ID on NoviaHub exactly.
    max_context_size Required. The model’s context length in tokens, shown as Context on the model’s page under Models & Pricing (deepseek-v4-flash listed 1,000,000 on 2026-09-28).
  3. Check the config file:

    终端窗口
    kimi doctor

    It only validates config.toml and tui.toml; it doesn’t start the interface or change either file.

  4. Run kimi. New sessions use the model set in default_model.

  1. Send one message in non-interactive mode; the answer is printed straight to the terminal:

    终端窗口
    kimi -p "Introduce yourself in one sentence"
  2. You can also run kimi provider list to see the configured providers.

  3. Check the call and its cost under Usage Logs in the NoviaHub console.

  • Add a model: add another [models."<alias>"] table with provider set to noviahub, model set to the NoviaHub model ID and max_context_size set to that model’s context length.
  • Switch models: run /model in the interface, or pass an alias at launch, for example kimi -m noviahub/deepseek-v4-flash.
  • Which models: type = "openai" uses the Chat Completions API, so pick models that carry the Chat label under Models & Pricing. Every model on the site carried it on 2026-09-28.
  • Use the Responses API: Kimi Code CLI also supports type = "openai_responses" (the OpenAI Responses API, configured the same way as openai). Only models whose page shows the Response label work with such a provider.
  • /login is only for signing in to the Kimi Code managed service or entering a Kimi Platform API key. It is not how you connect NoviaHub; edit config.toml as above.
  • Set exactly one of api_key and api_key_env. api_key writes the key into the config file in plain text, which isn’t recommended.
  • To keep the data directory elsewhere, set the environment variable KIMI_CODE_HOME; the config file is then $KIMI_CODE_HOME/config.toml.

Checked on 2026-09-28: