canonical_url: https://yycode.net/docs/en/openclaw-quickstart
lang: en
updated_at: 2026-07-04T13:33:48.616Z
source_html: https://yycode.net/docs/en/openclaw-quickstart

# yycode x OpenClaw Quick Start Guide

## Applicable Scenario

This document solves one thing only: connect OpenClaw's model service to yycode and complete a usability check.

If you have not installed Node.js yet, please first follow the [Node.js Environment Installation Guide](nodejs-setup).

---

## 1. Preparation

Before you begin, make sure:

- You have already created an API Key in the [yycode console](https://yycode.net/console/token)
- You know the actual model name you want to call, such as `gpt-5.4` (see the [Supported Models](#supported-models) section below for the full list)
- Your runtime environment meets OpenClaw's official requirements: recommended `Node 24`, compatible with `Node 22.16+`
- Windows users are advised to install and run OpenClaw with `WSL2 + Ubuntu` first

---

## Supported Models

### OpenAI-compatible Models

| Model name |
|---|
| `gpt-5.4` |
| `gpt-5.2` |
| `gpt-5.3-codex` |
| `gpt-5.2-codex` |
| `gpt-5.1-codex-max` |
| `gpt-5.1-codex-mini` |

### Anthropic-compatible Models

| Model name |
|---|
| `claude-opus-4-6` |
| `claude-sonnet-4-6` |
| `claude-haiku-4-5-20251001` |

---

## 2. Recommended Path: Use the OpenClaw Wizard

If you only want to connect OpenClaw and yycode first, the easiest way is to run OpenClaw's built-in wizard, verify that the browser console can reply normally, and then continue configuring channels or background services.

### Step 1: Install OpenClaw

On macOS / Linux / WSL2, you can run the official installation script directly:

```bash
# Install the openclaw CLI tool. --no-onboard means do not automatically enter the wizard after installation
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
```

After installation, you can first verify that the command is available:

```bash
openclaw --help
```

### Step 2: Start the onboarding wizard

```bash
openclaw onboard
```

### Step 3: Select a custom provider in the wizard

When the wizard reaches the model and authentication steps, choose `Custom provider`, then fill in the following values:

| Field | Value |
|---|---|
| Compatibility type | `Anthropic-compatible` or `OpenAI-compatible` |
| Base URL | See the note below |
| Model name | `claude-sonnet-4-6` or `gpt-5.4` (see [Supported Models](#supported-models) for the full list)|
| Provider ID | `yycode` |
| API Key | The yycode API Key you created |

> **Base URL instructions:**
> - When selecting `Anthropic-compatible`, enter: `https://yycode.net`
> - When selecting `OpenAI-compatible`, append `/v1` at the end and enter: `https://yycode.net/v1`

### Step 4: Finish the wizard and verify

For the first connection, you can keep the gateway port, bind mode, and background service settings at their defaults. After finishing the wizard, run the following in order:

```bash
# Check whether the configuration format is correct
openclaw doctor

# View current status and loaded models
openclaw status

# Open the local console and send a message to verify that replies work normally
openclaw dashboard
```

If a message sent in the console receives a model reply, the connection is successful.

---

## 3. Scripted Integration

If you want to include OpenClaw initialization in a script, server deployment flow, or enterprise image, we recommend using non-interactive mode.

### Step 1: Export the API Key

```bash
# First write the yycode API Key into an environment variable
export CUSTOM_API_KEY="YOUR_yycode_API_KEY"
```

### Step 2: Run the non-interactive onboarding command

```bash
# Non-interactive onboarding: configure yycode as a custom provider
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice custom-api-key \
  --custom-base-url "https://yycode.net" \
  --custom-model-id "gpt-5.4" \
  --custom-provider-id "yycode" \
  --custom-compatibility openai \
  --secret-input-mode ref \
  --gateway-port 18789 \
  --gateway-bind loopback
```

### Step 3: Confirm the environment variable name

If you use `--secret-input-mode ref`, the current OpenClaw version usually saves the API Key as an environment variable reference. We recommend using `CUSTOM_API_KEY` as shown above, which stays consistent with the official automation documentation.

If you have already generated a configuration, you can also open `~/.openclaw/openclaw.json` to check the actual referenced variable name. If your version writes a different variable name, add the corresponding variable according to the actual configuration, for example:

```bash
export OPENAI_API_KEY="YOUR_yycode_API_KEY"
```

---

## 4. Manually Check or Write the Configuration

If you do not want to run the wizard, you can directly inspect or edit `~/.openclaw/openclaw.json`.

Below is a configuration example you can reference directly. Replace the model name and API Key variable with your actual values:

```json5
{
  agents: {
    defaults: {
      // The default model must use the "provider ID/model name" format, not just the model name
      model: { primary: "yycode/gpt-5.4" },
    },
  },
  models: {
    providers: {
      dragoncode: {
        baseUrl: "https://yycode.net",
        // Reference an environment variable to avoid writing the key in plaintext in the config file
        apiKey: "${CUSTOM_API_KEY}",
        api: "openai-completions",
        models: [
          {
            // Replace this with the actual model name available in the yycode console
            id: "gpt-5.4",
            name: "gpt-5.4",
          },
        ],
      },
    },
  },
}
```

> **Most common mistake**: The default model must be written as `yycode/model-name`, for example `yycode/gpt-5.4`; do not write only `gpt-5.4`.

---

## 5. Success Criteria

If the following conditions are met, the integration is basically working:

- The base URL is `https://yycode.net`
- The API Key is still valid, not expired, disabled, or out of quota
- The default model is written as `yycode/your-model-name`
- `openclaw doctor` and `openclaw status` do not report configuration errors
- The browser console can send messages and receive replies normally

---

## 6. FAQ

### I entered the address, but it still cannot connect

First check whether the base URL is `https://yycode.net`. Do not include a trailing /

### OpenClaw starts, but sending a message reports that the model does not exist

Usually check these two items first:

- Whether the model name you entered is exactly the current call name actually available in yycode
- Whether the default model is written as `yycode/model-name`, rather than only the model name

### The scripted command reports that the API Key is missing

This usually means the environment variable was not truly exported successfully, or the variable name does not match the one referenced in the OpenClaw configuration.

You can directly open `~/.openclaw/openclaw.json` to confirm which environment variable the `apiKey` field references, then add the corresponding variable in the current shell. Following the recommended path in this document, check `CUSTOM_API_KEY` first.

### I have configured OpenClaw. Why still cannot use it in WhatsApp or Telegram?

This is usually not a model integration issue; the channel has not been configured yet. This page only connects model calls between OpenClaw and Dragon Code. For channel configuration, continue reading the [official OpenClaw Channels documentation](https://docs.openclaw.ai/channels).

---

## 7. Next Steps

- Have not created a Key yet: go back to the [yycode console](https://yycode.net/console/token) and create an API Key first
- Want to configure other development tools first: continue with the [Claude Code Quick Start Guide](claude-code-quickstart) and [Codex Quick Start Guide](codex-quickstart)
- Need to install the runtime environment: see the [Node.js Environment Installation Guide](nodejs-setup)
- Encounter common integration issues: see [FAQ](faq)
