Nbility logoNbility Docs

Search documentation

Search guides and API reference content

Qwen Code can read model configuration through an OpenAI-compatible setup, so it can be used directly with Nbility.

Install Qwen Code

Choose one method:

pnpm install -g @qwen-code/qwen-code
npm install -g @qwen-code/qwen-code
yarn global add @qwen-code/qwen-code
bunx --global @qwen-code/qwen-code

Set Environment Variables

Before starting, write the API Key, Base URL, and model name:

export OPENAI_API_KEY="sk-xxx"
export OPENAI_BASE_URL="https://api.nbility.dev/v1"
export OPENAI_MODEL="gpt-5"
$env:OPENAI_API_KEY="sk-xxx"
$env:OPENAI_BASE_URL="https://api.nbility.dev/v1"
$env:OPENAI_MODEL="gpt-5"
set OPENAI_API_KEY="sk-xxx"
set OPENAI_BASE_URL="https://api.nbility.dev/v1"
set OPENAI_MODEL="gpt-5"

Important: sk-xxx is only a placeholder. Replace it with the real token you created on /console/token.

Quick Start

After the environment variables are ready, enter your project directory and run:

cd my-project
qwen

If Qwen Code starts and completes a chat successfully, the integration works.

Persist the Configuration

To avoid setting variables manually every time, add the environment variables to the corresponding shell profile:

  • Linux or macOS: add them to ~/.bashrc or ~/.zshrc
  • Windows PowerShell: add them to $PROFILE

Tips

  • If you only want to verify the connection, start with one default model
  • If setup fails, first check whether the environment variables are active in the current terminal
  • To switch models later, only change OPENAI_MODEL