VS Code / Cursor / Trae Configuration Guide
Last updated: October 17, 2026 (Asia/Shanghai)
Related: Help Center · Claude Code · Codex · LLM API
Supported IDEs (all based on the VS Code ecosystem; extensions are largely compatible):
| IDE | Description |
|---|---|
| VS Code | Microsoft's official editor |
| Cursor | AI-enhanced editor |
| Trae | ByteDance's AI editor |
Common extension options: the Claude Code extension, the Codex extension, and OpenAI-compatible agents such as Cline / Roo Code.
1. Prepare a token
Create a dedicated token in the console (e.g. vscode) and copy sk-xxxxxxxx. We recommend setting a quota cap.
2. Cursor built-in model settings
- Open Settings → Models (or Cursor Settings).
- Enter
sk-xxxxxxxxin OpenAI API Key. - Enable Override OpenAI Base URL and enter:
https://ai.afp.net/v1(with/v1). - Add model and manually add the platform model ID, for example:
claude-sonnet-4-6gemini-3.1-prokimi-k3deepseek-v4-flash
- Click Verify / Save.
INFO
Some Cursor requests are sent from Cursor's cloud, so https://ai.afp.net must be publicly reachable. Features such as Tab completion may still use Cursor's own models and will not use your custom key.
3. Claude Code for VS Code
- Install the CLI in a terminal (the extension usually relies on the same configuration):
npm install -g @anthropic-ai/claude-code- Search for Claude Code in the extension marketplace and install the extension published by Anthropic.
- Configure
~/.claude/settings.json(the same as for Claude Code CLI):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxx",
"ANTHROPIC_BASE_URL": "https://ai.afp.net",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"alwaysThinkingEnabled": true
}Note: the Base URL for the Claude path does not include /v1. After changing it, fully quit and restart the IDE.
4. Codex extension
npm install -g @openai/codex- Install the OpenAI Codex extension.
- Configure
~/.codex/config.toml(base_urlwith/v1) andauth.jsonas described in Codex CLI. - Restart the IDE. For the model field, enter an ID that has been verified to work on the platform.
5. Cline / Roo Code (OpenAI Compatible)
- Install the Cline or Roo Code extension.
- Set API Provider to OpenAI Compatible.
- Fill in:
- Base URL:
https://ai.afp.net/v1 - API Key:
sk-xxxxxxxx - Model ID: e.g.
gemini-3.1-proorclaude-sonnet-4-6
- Base URL:
- Save and test in the sidebar chat.
If the extension supports a custom Anthropic Base URL, use the following instead:
- Provider: Anthropic
- Custom Base URL:
https://ai.afp.net(no/v1) - Key: the same
sk-
6. Other OpenAI-compatible extensions
For any plugin that asks for an OpenAI Base URL, you usually enter https://ai.afp.net/v1. If you get a 404, check "with / without /v1" against this page and LLM API.
7. Troubleshooting
| Symptom | Fix |
|---|---|
| Claude can't connect | Check whether the Base URL has an extra /v1, and restart the IDE after fixing it |
| Roo / Cline 404 | Check whether the Base URL is missing /v1 |
| Cursor Verify fails | Check the key, public reachability, and whether the model ID matches /v1/models |
| Configuration changes don't take effect | Fully quit the process and reopen it; do not just Reload Window |
| Insufficient quota | Check the balance and token quota in the console |
How should I choose a model?
| Type | Examples | Scenario |
|---|---|---|
| General-purpose coding | claude-sonnet-4-6 | Daily recommendation |
| Heavy reasoning | claude-opus-4-8, claude-opus-5 | Complex refactoring |
| Multimodal | gemini-3.1-pro | Reading images, wide context |
| Cost-effective | claude-haiku-4-5, gemini-3.5-flash, deepseek-v4-flash | Small changes, completion-style tasks |
Back to: Help Center