Cursor is a VS Code–based AI IDE. You can point its OpenAI-compatible settings—or the Claude Code extension—at 4AICode to share team tokens, quotas, and usage metering.
Before you start
- Create a token in Token management (
sk-4ai-...). - Pick a relay host:
- Mainland China:
https://relay.4aicode.net - International:
https://relay.4aicode.com
- Mainland China:
Option A: Cursor model settings (OpenAI-compatible)
Best when you use Cursor’s built-in Chat / Agent with GPT-style models.
- Open Cursor Settings → Models.
- Enable the OpenAI API key / custom base URL options (labels vary by Cursor version).
- Set:
- API Key:
sk-4ai-<your-token> - Base URL:
https://relay.4aicode.com/v1(use.neton mainland networks)
- API Key:
- Choose a supported model ID such as
gpt-6-astraorgpt-5.6-sol. See the model catalog. - Send
pingin a new chat, then confirm the call under Usage.
Cursor Chat and the Claude Code extension are independent. Chat uses the OpenAI-compatible settings; Claude Code uses the Anthropic Messages protocol.
Option B: Claude Code extension
Follow the VS Code / Cursor / Windsurf guide and set:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://relay.4aicode.com" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-4ai-xxxxxxxxxxxxxxxx" }
]
}
Fully quit and reopen Cursor so the variables reload.
Troubleshooting
- Still prompted to log in: OpenAI-compatible URLs need
/v1;ANTHROPIC_BASE_URLdoes not. - Unknown model: Copy the exact ID from the model catalog.
- 401 / 429: See 401 and 429.