Skip to content

Command-line agents

OpenClaw

Add NoviaHub to OpenClaw as a custom model provider.

OpenClaw is an open source AI assistant that runs on your own computer and connects to the chat apps you already use. Models are called by its Gateway, a service that runs in the background. Add a custom provider to its config file and it can use models on NoviaHub.

  • A NoviaHub API key. If you don’t have one yet, see API keys.
  • Funds in your account. Calls are charged to your balance by usage.

OpenClaw runs on macOS, Linux and Windows and needs Node.js 24.16+ or 26.1+. The installer script is the recommended route: it detects your system, installs Node.js if it’s missing, installs OpenClaw and starts onboarding. Use any of the official methods:

终端窗口
curl -fsSL https://openclaw.ai/install.sh | bash

OpenClaw also offers a Windows Hub app and a macOS .dmg.

  1. Put the API key in ~/.openclaw/.env. The Gateway only sees the environment of its own process. When it runs as a background service (launchd on macOS, systemd on Linux and so on), variables you export in a terminal may not reach it. OpenClaw recommends keeping provider API keys in the global ~/.openclaw/.env file. Open (or create) that file and add one line:

    ~/.openclaw/.env
    NOVIAHUB_API_KEY=sk-...

    The file holds your key. OpenClaw’s security guidance is to keep files under ~/.openclaw at 600 (read/write for you only), so run:

    终端窗口
    chmod 600 ~/.openclaw/.env
  2. Edit the config file ~/.openclaw/openclaw.json and add the NoviaHub provider (if the file already has settings, merge models.providers.noviahub and agents.defaults.model into them):

    ~/.openclaw/openclaw.json
    {
    "models": {
    "providers": {
    "noviahub": {
    "baseUrl": "https://noviahub.com/v1",
    "apiKey": "${NOVIAHUB_API_KEY}",
    "api": "openai-completions",
    "models": [
    {
    "id": "deepseek-v4-flash",
    "name": "deepseek-v4-flash",
    "contextWindow": 1000000
    }
    ]
    }
    }
    },
    "agents": {
    "defaults": {
    "model": { "primary": "noviahub/deepseek-v4-flash" }
    }
    }
    }

    What each field means:

    Field Meaning
    noviahub The provider ID. You refer to models as noviahub/<model ID>.
    baseUrl With openai-completions or openai-responses, include /v1: https://noviahub.com/v1.
    apiKey ${NOVIAHUB_API_KEY} reads an environment variable. Only upper-case names are substituted: upper-case letters, digits and underscores, not starting with a digit.
    api The request protocol. openai-completions is the Chat API, and also the default when api is left out.
    models[].id The model ID on NoviaHub. It must match exactly.
    models[].contextWindow The context window. Without it, OpenClaw budgets for 200,000 tokens. The example value is the Context shown on Models & Pricing on 2026-09-28; the page is authoritative.
  3. Restart the Gateway so it picks up the new key:

    终端窗口
    openclaw gateway restart

    Later changes to openclaw.json don’t need a restart; the Gateway watches the file and applies them.

终端窗口
# List the models under the noviahub provider
openclaw models list --provider noviahub
# Ask one question with the model, without opening the chat interface
openclaw infer model run --model noviahub/deepseek-v4-flash --prompt "Introduce yourself in one sentence."

According to the docs, models written out under models.providers.<provider ID>.models appear in openclaw models list, so the first command should list noviahub/deepseek-v4-flash. The second reads the model and key from your config, sends one request and prints the reply. If you get a reply and the call shows up under Usage Logs in NoviaHub, the setup works. Then run openclaw tui to open the chat interface.

  • In a chat, type /model to switch.
  • From the command line: openclaw models set noviahub/<model ID>.
  • Change agents.defaults.model.primary in the config to set the default.

Add a model to the models list before using it. Match the protocol to the model: openai-completions needs the Chat endpoint label, openai-responses needs Response and anthropic-messages needs Anthropic. The labels are on each model’s page under Models & Pricing.

To call Claude models over the Anthropic protocol, add a second provider with api set to anthropic-messages and baseUrl set to https://noviahub.com (without /v1).

  • OpenClaw validates its config strictly: if it finds a key it doesn’t know, the Gateway refuses to start. If it fails to start after an edit, check your spelling first.
  • Without contextWindow, OpenClaw assumes 200,000 tokens. Many NoviaHub models have larger contexts, so fill in the real value.

Checked on 2026-09-28 and 2026-09-29: