Skip to main content
ZCode is an AI coding assistant from Zhipu AI that supports custom providers compatible with the OpenAI and Anthropic protocols. For HaiToken, the OpenAI path is usually the most stable and broadly compatible choice; if you explicitly want the Claude / Anthropic ecosystem, you can also use the Anthropic path.

What you need

  • A HaiToken API key
  • HaiToken OpenAI-compatible address: https://api.haitoken.ai/v1
  • HaiToken Claude / Anthropic-compatible address: https://api.haitoken.ai
  • At least one available model ID, such as gpt-5.4
ZCode is configured entirely through the GUI, so the steps are essentially the same on Windows, macOS, and Linux. If menu placement or dialog layout differs slightly on your system, follow the actual UI — the API key, Base URL, and model ID values remain the same.

Setup Steps

Choose the protocol first

In ZCode, the two common choices are:
  • OpenAI: recommended first, broader compatibility, and the main flow in this guide
  • Anthropic: also common, useful when you explicitly want the Claude / Messages ecosystem
If you do not have a strong reason, start with OpenAI.

Step 1: Open Model Settings

In the ZCode main interface, click Model Settings in the left sidebar to open the model provider management page.

Step 2: Add a Custom Provider

In the Custom Providers area of the model settings page, click the + Add Provider button to open the provider configuration form.

Step 3: Fill in HaiToken Configuration

In the provider configuration form, enter the following:
HaiToken supports both OpenAI Chat Completions and OpenAI Responses. If the Base URL field displays a /responses suffix after you select an OpenAI option, ZCode will use POST /v1/responses, which is supported. Select an OpenAI option without /responses only when you specifically need Chat Completions (POST /v1/chat/completions).
If you choose the Anthropic path, do not enter https://api.haitoken.ai/v1. This path should use the Anthropic-style gateway prefix https://api.haitoken.ai, and the client should call /v1/messages through that gateway.

Step 4: Add Models

In the Model List area, click + Add Model and enter the HaiToken model ID you want to use, such as gpt-5.4. You can add multiple models.

Step 5: Save the Provider

After filling in the fields, click the Add Provider button at the bottom of the form to save the configuration.

Step 6: Verify Connectivity

After saving, switch to the newly configured HaiToken model in the ZCode chat or coding panel, and send a simple message (such as hello) to verify connectivity.

Notes

If you need to configure advanced parameters such as temperature, max output length, or system prompt, keep the defaults for your first test and verify connectivity first.

FAQ

Next