Client setup

Cline & Roo Code Setup Guide

Import keys in one click with ZhenAPI Toolkit, or configure Anthropic Messages and OpenAI-compatible endpoints in Cline and Roo Code for VS Code.

Cline and Roo Code are popular open-source autonomous coding extensions for VS Code (and VS Code forks such as Cursor and Windsurf), alongside Cline Desktop and CLI. Connecting them to ZhenAPI gives you native Anthropic Prompt Caching and Extended Thinking for Claude, as well as OpenAI-compatible access to GPT, Gemini, DeepSeek, GLM and Kimi.

Channel Group Tip: When creating a key on the API Keys page, pick a general-purpose group such as Claude Max (External), Claude Official, Codex Pro (External), DeepSeek or Gemini. Do not select "Claude Code only" or "Codex only" groups, which return 403 in third-party extensions.

Option 1: One-Click Import via ZhenAPI Toolkit (Windows)

  1. Download and sign in to ZhenAPI Toolkit for Windows.
  2. Locate Cline on the Overview screen, click Import Key, and select your API key and preferred model.
  3. Toolkit previews every change to ~/.cline/data and creates an encrypted backup before writing. Reload VS Code or Cline Desktop to start coding, or click "Remove ZhenAPI" in Toolkit anytime to roll back.

Option 2: Manual Setup in Cline or Roo Code (VS Code)

Open the Cline or Roo Code sidebar in VS Code and click the gear icon to open API Configuration:

1. Anthropic Claude Models (Recommended: Native Anthropic Protocol)

  • API Provider: select Anthropic
  • Anthropic API Key: paste your ZhenAPI sk-... key
  • Check Use custom base URL and enter (do NOT append /v1):
Anthropic Custom Base URL (no /v1)
1https://api.zhenapi.ai
  • Model: choose or enter a model supported by your group such as claude-sonnet-4-6 or claude-opus-4-6 (check Pricing). Prompt Caching works out of the box, cutting multi-turn context read costs by up to 90%.

2. GPT, Gemini, DeepSeek & GLM Models (OpenAI Compatible)

  • API Provider: select OpenAI Compatible
  • Base URL: enter the OpenAI-compatible endpoint (with /v1):
OpenAI Compatible Base URL (with /v1)
1https://api.zhenapi.ai/v1
  • API Key: paste your group's sk-... key
  • Model ID: enter the exact model name listed on the Pricing page (e.g. gpt-5.4, deepseek-reasoner, gemini-3.1-pro, glm-5.4), then click Done / Save.

Troubleshooting

IssueCauseSolution
404 Not Found or /v1/v1/messages errorAdded /v1 to the Anthropic base URL, or omitted /v1 from the OpenAI Compatible base URL.Use https://api.zhenapi.ai for Anthropic, and https://api.zhenapi.ai/v1 for OpenAI Compatible.
403 client restriction errorKey belongs to a "Claude Code only" or "Codex only" group.Reassign the key to an External or Official group on the API Keys page.
Occasional 429 during rapid multi-file editsBurst requests exceeded concurrency or rate limits.Set a 1–2s request delay in Cline/Roo Code settings or review Error Codes.