Qwen Code recipe

How to use Qwen Code with OpenAI-compatible endpoints without losing your base URL.

When Qwen Code is pointed at a custom OpenAI-compatible endpoint, the real failure is often not the model itself. It is which layer wins for baseUrl, which model id survives normalization, and whether the final request host matches what you think you configured.

DeepSeek naming note: for new tests use deepseek-v4-flash or deepseek-v4-pro. The older aliases deepseek-chat and deepseek-reasoner are scheduled to retire on July 24, 2026.

1. Keep the first test brutally small

Before debugging Qwen Code behavior, confirm that your endpoint, token and model work with one raw request.

curl https://api.blackeaglecambodia.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-token" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

2. Make each provider entry explicit

If several models share one endpoint, the practical workaround is still to keep baseUrl explicit on every modelProviders entry until the configuration bug is fully fixed upstream.

{
  "$version": 3,
  "env": {
    "BLACK_EAGLE_API_KEY": "sk-your-token"
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "modelProviders": {
    "openai": [
      {
        "id": "deepseek-v4-flash-black-eagle",
        "name": "Black Eagle DeepSeek Flash",
        "envKey": "BLACK_EAGLE_API_KEY",
        "baseUrl": "https://api.blackeaglecambodia.com/v1"
      },
      {
        "id": "deepseek-v4-pro-black-eagle",
        "name": "Black Eagle DeepSeek Pro",
        "envKey": "BLACK_EAGLE_API_KEY",
        "baseUrl": "https://api.blackeaglecambodia.com/v1"
      }
    ]
  }
}

If Qwen Code keeps routing a request somewhere else, inspect the final request host. The useful question is not what you saved. It is what the runtime actually sent.

3. Debug order that wastes the least time

  1. Run one raw /chat/completions request outside Qwen Code.
  2. Keep one endpoint and one model id per visible provider entry.
  3. Confirm the final request host is your intended endpoint, not a provider default.
  4. Only after that, test switching models, shared settings, or more advanced flows.

4. What usually goes wrong

Symptom Likely cause Fastest check
Custom endpoint ignored A later config layer rewrites baseUrl during model resolution. Inspect the final runtime host.
Wrong model selected Several models share one provider shape and Qwen picks the first matching entry. Give each entry a distinct visible id/name.
Looks like auth failure The request went to the default vendor endpoint, not your intended OpenAI-compatible host. Test raw curl against the exact target host first.

5. If the endpoint itself is the blocker

If the real delay is not Qwen Code but getting one working OpenAI-compatible endpoint with prepaid credits, Black Eagle AI keeps the first step small so you can separate access friction from IDE friction.

See the $5 starter flow See the $10 personal path Open the integrations snippet Read the billing FAQ