Client Tool Access Overview
This article introduces how to configure the interface of this site in the editor, desktop assistant and command line tool. Please select the tutorial according to the tool you are using, and set the function switches according to the model capabilities.
Prepare three pieces of information first
First create and copy an API Key (access key, used to identify your account and deduct the call limit) on the "API Keys" page of the ShangHai Do console. It will be referred to as "this site token" below.
All tools require the following three pieces of information:
| Project | Fill in content |
|---|---|
| API Keys / API Key | Create and copy on the API Keys page; replace YOUR_API_KEY with your full key |
| Interface address / Base URL | For most tools, fill in https://shanghaido.com/v1; some tools require the complete path, please refer to each tutorial |
| Model name | First call GET /v1/models, and then fill in the returned accurate id; the example in this article uses qwen3.8-flash |
YOUR_API_KEY is a placeholder, please replace it with the token you created in ShangHai Do. Do not commit real tokens to repositories, screenshots, or public configuration files.
If you use other ShangHai Do deployment, replace https://shanghaido.com with the root address of the site you visit, and keep the path required by the tutorial. Agent is an assistant that can read and write files and perform tasks; CLI refers to the client that operates through commands in the terminal; Chat Completions, Responses, and Messages are three request formats that must be consistent with the tool configuration.
Select by tool
| Tool | Type | Official custom interface method | Recommended protocol | Suitable for what | Important restrictions |
|---|---|---|---|---|---|
| Cursor | Standalone Editor | OpenAI API Key + Override OpenAI Base URL | Chat Completions | Dialog, Agent, Editing | Tab completion continues to use Cursor’s built-in model; some Agent capabilities require paid packages |
| TRAE China Version | Independent Editor | Custom Model + Full URL | Chat Completions | Dialogue, Agent, Editing | This article is written according to the official Chinese version; other versions are subject to the actual interface |
| VS Code | Editor | Custom Endpoint | Chat Completions, Responses, Messages | Chat, Agent, Editor | The organization administrator may turn off the function of bringing your own model key |
| WorkBuddy | Desktop Task Assistant | "Custom API" in settings | OpenAI compatible | Dialogue, task, tool call | The ability switch of the custom model must be filled in according to the actual ability |
| JetBrains AI Assistant | IntelliJ IDEA, PyCharm, etc. | OpenAI-compatible endpoint | Chat Completions | AI Chat, code operation, Agent | Code completion is configured separately, and ordinary chat models may not be suitable for completion |
| Cline | VS Code plug-in | OpenAI Compatible | Chat Completions | Agent, reading and writing projects, tools | requires model support tool call to complete Agent operation |
| Roo Code | VS Code plug-in | OpenAI Compatible | Chat Completions | Agent, reading and writing projects, tools | only uses native tool calls and does not provide XML tool call downgrade |
| Continue | VS Code / JetBrains plug-in | provider: openai + apiBase |
Chat Completions | Chat, edit, apply patches | Automatic completion requires a special completion model, and ordinary chat capabilities cannot be regarded as completion capabilities |
| Kilo Code | VS Code plug-in / command line | Custom provider | Chat Completions | Agent, tool, command line | CLI configuration also needs to fill in the context and output upper limit for the model |
| Zed | Independent editor | OpenAI-compatible provider | Chat Completions | Agent, Inline Assistant, submission information | External Agent and Terminal Threads have their own model configuration |
| Qwen Code | Command Line | modelProviders.openai |
Chat Completions | Command line programming Agent | needs to explicitly select openai protocol |
| Aider | Command Line | OPENAI_API_BASE |
Chat Completions | Command line code change | model parameters must use the openai/模型名 form |
| CodeBuddy CLI | Command Line | models.json Custom Model |
Chat Completions | Command line programming Agent | Custom model url usually needs to write the complete /chat/completions path |
| Codex | Command Line/Editor | Custom Supplier | Responses | Programming Agent | requires model support Responses and tool calls |
| Claude Code | Command line | Anthropic gateway address | Messages | Programming Agent | Anthropic officially does not guarantee third-party gateway routing to non-Claude models |
| OpenCode | Command line/Editor | OpenAI-compatible provider | Chat Completions | Programming Agent | Please set the tool call and output parameters according to the model capabilities |
Common calling example
For your first connection, follow Connection basics to register, create an API key, and query available models. After a request, check usage and charges in the console's Usage Logs.
First use the simplest non-continuous output to confirm that the address, token and model name are correct. Linux, macOS, Git Bash:
curl "https://shanghaido.com/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-flash",
"messages": [{"role": "user", "content": "请回复:连接成功"}],
"max_tokens": 512,
"stream": false
}'
Windows PowerShell:
$env:SHANHAI_API_KEY = "YOUR_API_KEY"
$body = @{
model = "qwen3.8-flash"
messages = @(@{ role = "user"; content = "请回复:连接成功" })
max_tokens = 512
stream = $false
} | ConvertTo-Json -Depth 5
$result = Invoke-RestMethod `
-Uri "https://shanghaido.com/v1/chat/completions" `
-Method Post `
-Headers @{ Authorization = "Bearer $env:SHANHAI_API_KEY" } `
-ContentType "application/json; charset=utf-8" `
-Body ([System.Text.Encoding]::UTF8.GetBytes($body))
$result.choices[0].message.content
If choices[0].message.content is returned, start configuring the editor again. The model list can be queried like this:
curl "https://shanghaido.com/v1/models" \
-H "Authorization: Bearer YOUR_API_KEY"
Windows PowerShell query model list:
$models = Invoke-RestMethod `
-Uri "https://shanghaido.com/v1/models" `
-Headers @{ Authorization = "Bearer $env:SHANHAI_API_KEY" }
$models.data | Select-Object id
Access status of other tools
Windsurf
This page does not provide Windsurf configuration steps yet. If your version provides a custom interface entrance, please contact the site customer service and provide the version number and setting page information.
Reference: Current official model page。
Gemini CLI
Gemini CLI is mainly configured according to the Google GenAI protocol and is not a simple OpenAI compatible client. When accessing, you also need to confirm the model, request header, continuous output and tool calling format; if you need to use it, please contact the site customer service. Do not directly fill in the /v1 configuration in this article into the Gemini CLI.
Reference: Gemini CLI official certification document。
tool official information
For tool installation and setup instructions, please refer to the following official information:
- Cursor:Bring your own API key
- TRAE China version: built-in models and custom models
- VS Code:Language models and custom endpoints
- WorkBuddy: Model Configuration
- JetBrains AI Assistant:Use third-party and local models
- Cline:OpenAI Compatible
- Roo Code:OpenAI Compatible
- Continue:OpenAI-compatible providers
- Kilo Code:OpenAI-compatible providers
- Zed:Use API Access
- Qwen Code:Authentication and custom providers
- Aider:OpenAI compatible APIs
- CodeBuddy CLI:models.json
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.