VS Code (Cline)
Use Cline plugin in VS Code with AI models
VS Code + Cline
Cline is one of the most popular AI coding plugins for VS Code, supporting multiple model backends. With HAI Gateway, you can use Claude, GPT, Gemini and more directly in the editor.
Install Cline Plugin
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search Cline and install
Configure Claude Model
- Click the Cline icon in the sidebar
- Select API Provider → Anthropic
- Fill in the configuration:
| Setting | Value |
|---|---|
| API Key | sk-pat-YOUR_ACCESS_TOKEN |
| Base URL | https://api.hai.network/anthropic |
| Model | claude-sonnet-4-20250514 |
Configure OpenAI Model
- Select API Provider → OpenAI Compatible
- Fill in the configuration:
| Setting | Value |
|---|---|
| API Key | sk-pat-YOUR_ACCESS_TOKEN |
| Base URL | https://api.hai.network/openai/v1 |
| Model | gpt-4.1 |
Configure Gemini Model
- Select API Provider → OpenAI Compatible
- Fill in the configuration:
| Setting | Value |
|---|---|
| API Key | sk-pat-YOUR_ACCESS_TOKEN |
| Base URL | https://api.hai.network/google/v1beta |
| Model | gemini-2.5-pro |
Recommended Model Comparison
| Model | Use Case | Characteristics |
|---|---|---|
| claude-sonnet-4-20250514 | Complex coding tasks | Strong reasoning, high code quality |
| gpt-4.1 | Rapid iterative development | Fast response speed |
| gpt-4.1-mini | Daily coding assistance | Best cost-effectiveness |
| gemini-2.5-pro | Large codebase analysis | Ultra-long context window |
OpenAI Model Characteristics
GPT series models offer fast response speeds, making them ideal for rapid iterative development. gpt-4.1-mini provides the best cost-effectiveness.