Connect CodeBuddy to ModelGo: Setup & Troubleshooting

CodeBuddy Code is Tencent Cloud's terminal AI coding tool. Environment variables override its endpoint, key, and model to connect it to ModelGo. Before you start, create an API key in the ModelGo console and pick a logical model name from the Model Catalog.

1. Install

bash
npm install -g @tencent-ai/codebuddy-code
codebuddy --version

2. Configure ModelGo

Set these in the terminal that starts CodeBuddy:

bash
export CODEBUDDY_BASE_URL="https://api.modelgo.ai/v1"
export CODEBUDDY_API_KEY="mgk_your_api_key"
export CODEBUDDY_MODEL="your-model-id"

3. Start and verify

bash
curl https://api.modelgo.ai/v1/models \
  -H "Authorization: Bearer $CODEBUDDY_API_KEY"
codebuddy -p "Describe this project in one sentence"

Troubleshooting

  • Still uses the default model or endpoint: make sure the variables are visible in the current terminal, then restart codebuddy.
  • 401 / 403: check that CODEBUDDY_API_KEY and CODEBUDDY_MODEL are a valid key and a callable logical model name.
  • 404: CODEBUDDY_BASE_URL must be https://api.modelgo.ai/v1.

Related docs