Models Hub
User Guide

CLI One-click Setup

Use the Models Hub CLI to automatically configure Claude Code, Codex, Gemini CLI, and OpenClaw.

Edit this page

The Models Hub CLI is a local command-line configuration tool that writes your Models Hub API Key, API URL, and default model into the local config files of mainstream Agent tools in one click — saving you the hassle of editing each one by hand.

Use Cases

  • You already have a Models Hub API Key and want to quickly connect your commonly used Agent tools to Models Hub.
  • You use Claude Code, Codex, Gemini CLI, or OpenClaw on the same machine and don't want to edit config files one by one.
  • You need to quickly initialize Agent tool configuration with a script on a new computer, server, or team environment.
  • For Claude Code, Gemini CLI, and others, settings are merged in to preserve your existing configuration as much as possible.

Models Hub CLI interactive configuration

One-Click Install

Pick the command for your operating system (it is generated automatically from the site domain you are currently visiting):

curl -fsSL https://your-domain/cli/install.sh | sh

After installation, reopen your terminal or PowerShell and confirm the command is available:

models --help

Installation location

On macOS, Linux, and Windows, it installs to ~/.local/bin/models by default (on Windows, that is %USERPROFILE%\.local\bin\models.exe). If you get a "command not found" error for models, confirm the install directory is on your PATH, or reopen your terminal. Supported systems: macOS (Intel / Apple Silicon), Linux (x64 / arm64), Windows (x64 / arm64).

Interactive Configuration

Simply run:

models

The CLI displays an interactive menu where you can choose to configure all tools or just a single target. As prompted, first enter the access URL (the site domain you are currently using, without a trailing /), then enter your Models Hub API Key and model name; the tool then automatically writes the config files for the corresponding platforms.

Supported targets:

TargetDescription
allConfigure Claude Code, Codex, Gemini CLI, and OpenClaw all at once
claudeConfigure Claude Code
codexConfigure Codex CLI
geminiConfigure Gemini CLI
openclawConfigure OpenClaw

Non-Interactive Configuration

Ideal for scripts, CI, or bulk initialization. --yes uses default values for any unspecified API URL and model, requiring no manual input:

# Configure all tools at once with a single API Key
models configure --target all --api-key <YOUR_API_KEY> --yes

# Configure only Claude Code and Codex
models configure --target claude,codex --api-key <YOUR_API_KEY>

# You can also provide the API Key via an environment variable
export MODELS_API_KEY=<YOUR_API_KEY>
models configure --target all --yes

Command-line options

OptionDescription
--target <list>Target tools: codex, claude, gemini, openclaw, or all (default all)
--base-url <url>Access URL (the site domain you are currently using, without a trailing /)
--api-key <key>API key; if not provided, you'll be prompted to enter it, or it's read from the MODELS_API_KEY environment variable
--model <model>Use the same model for all selected tools
--codex-model <name>Specify the model for Codex only
--claude-model <name>Specify the model for Claude Code only
--gemini-model <name>Specify the model for Gemini CLI only
--yesUse default values for any unspecified base URL and model
-h, --helpShow help

Default models: gpt-5.5 for Codex, claude-sonnet-4-6 for Claude Code, and gemini-3.1-pro-preview for Gemini CLI.

Config Files Written

After running, the CLI writes the API Key, Base URL, and model to each tool's standard configuration location:

ToolFiles written
Codex~/.codex/config.toml, ~/.codex/auth.json
Claude Code~/.claude/settings.json (merges env, preserves existing settings)
Gemini CLI~/.gemini/settings.json, ~/.gemini/.env
OpenClaw~/.openclaw/openclaw.json, ~/.openclaw/.env

Once configured, just launch the corresponding tool to use Models Hub's model services — there's no need to set environment variables manually.

Tip: After the configuration is written, all requests from the corresponding tool go through the Models Hub endpoint (ANTHROPIC_BASE_URL / OPENAI_BASE_URL, etc.) and use your Models Hub quota, rather than each vendor's official account.

More Agent Tool Configuration Entries

The cards below match the Connecting Agent Tools page. You can continue to view the detailed configuration for each tool.

One-click configuration for mainstream agent platforms, for effortless use of various agent tools

Use the Models Hub CLI to automatically configure Claude Code, Codex, Gemini CLI, and OpenClaw.

AstrBot - Agent Chatbot

A multi-platform chatbot and Agent framework that connects to OpenAI-compatible model services.

CC Switch

One-click management of provider, MCP, and prompt configurations for Claude, Codex, and Gemini CLI.

Cherry Studio

A desktop AI assistant client supporting multi-model conversations and multi-role management.

Claude Code

A terminal code assistant powered by Anthropic Claude, with multi-file collaborative editing.

CodeBuddy

An AI coding assistant that connects to OpenAI-compatible APIs via local JSON model configuration.

Codex CLI

A command-line AI code assistant with sandboxing and patch-style editing.

Gemini CLI

Google Gemini CLI, with one-click writing of the API Key, default model, and base URL via the Models Hub CLI.

Copilot CLI

Connect to a custom OpenAI-compatible model gateway via BYOK mode.

Crush

An open-source terminal AI coding agent from Charm with a responsive TUI.

Cursor

An AI-native code editor that connects to model services via a custom Base URL.

Factory Droid CLI

An AI assistant for software engineering workflows, covering planning, development, and testing.

FluentRead - Open-Source Translation Plugin

An open-source browser translation plugin that connects to OpenAI-compatible translation models.

Hermes Agent

An open-source terminal AI agent from Nous Research that connects via a Custom Endpoint.

LangBot - Instant Messaging Bot Development Platform

An open-source bot development framework for instant messaging platforms.

LunaTranslator - Open-Source GalGame Translator

An open-source GalGame translator that can be configured with OpenAI-compatible translation services.

Memoh - Containerized AI Agent Platform

A containerized AI agent platform that can connect to custom model providers.

nanobot

A lightweight AI agent that quickly connects to model services via config.json.

Oh My Pi

A terminal AI coding Agent with thinking mode and deep reasoning level mapping configuration.

OpenClaw

A self-hosted AI assistant platform supporting multi-channel AI agent management.

OpenCode

An open-source terminal AI coding agent compatible with many model service providers.

Pi

A minimal yet highly extensible terminal coding framework supporting custom skills and templates.

On this page