# CodeWhale Integration Guide

CodeWhale is an open-source terminal AI coding tool that provides an interactive TUI interface, supporting code editing, streaming reasoning output, and workspace change approval. This article explains how to use it to call models through the UModelverse platform.

## **System Requirements**

| Platform | Requirements |
| --- | --- |
| Windows | Windows 10 or Windows 11 |
| macOS | macOS 10.15 (Catalina) or later |
| Linux | Mainstream distributions (Ubuntu, Debian, etc.) |

A network connection is required on all platforms.

## **1. Install CodeWhale**

Installation via npm is recommended:

```
npm install -g codewhale
```

Verify after installation:

```
codewhale --version
```

You can also install via Cargo (requires Rust 1.88+):

```
cargo install codewhale-cli --locked
cargo install codewhale-tui --locked
```

## **2. Configure the UModelverse API**

### 2.1 Obtain an API Key

Visit the [UModelverse Console](https://console.ucloud.cn/modelverse/api) to obtain your API key. For available models, see the [supported models](https://api-us-ca.umodelverse.ai/v1/models) on the UModelverse platform.

### 2.2 Write the Configuration File

Edit `~/.codewhale/config.toml` and fill in the following content (replace `YOUR_API_KEY` with your actual key):

```
[providers.umodelverse]
base_url = "https://api-us-ca.umodelverse.ai/v1"
api_key = "YOUR_API_KEY"
model = "deepseek-v4-pro"
```

You can also configure via environment variables:

macOS / Linux:

```
export DEEPSEEK_BASE_URL=https://api-us-ca.umodelverse.ai/v1
export DEEPSEEK_API_KEY=YOUR_API_KEY
export DEEPSEEK_MODEL=deepseek-v4-pro
```

Windows (PowerShell):

```
$env:DEEPSEEK_BASE_URL="https://api-us-ca.umodelverse.ai/v1"
$env:DEEPSEEK_API_KEY="YOUR_API_KEY"
$env:DEEPSEEK_MODEL="deepseek-v4-pro"
```

## **3. Launch CodeWhale**

Navigate to your project directory and use `--provider` to specify the custom provider:

```
cd your-project-folder
codewhale --provider umodelverse
```

You can also specify the model directly at launch:

```
codewhale --provider umodelverse --model deepseek-v4-pro
```

After launching, the interactive TUI interface will open and you can start coding. Run the following command to verify that the configuration and connection are working correctly:

```
codewhale doctor
```

## **Frequently Asked Questions**

### Authentication failure or unable to connect?

Please check each of the following:

1.  The `api_key` is from the UModelverse platform, copied in full with no extra spaces.

2.  The `base_url` is `https://api-us-ca.umodelverse.ai/v1` (with the `/v1` suffix).

3.  The `model` is one of the [supported models](https://api-us-ca.umodelverse.ai/v1/models) on the UModelverse platform and has been entered correctly.
