Integrating Qwen Code with Scaleway's Generative APIs
Qwen Code is a coding agent for terminal and IDE. You can integrate Scaleway's Generative APIs models to Qwen Code.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A valid API key for API authentication
- Installed Qwen Code on your local machine
Configure environment variables for Qwen Code
- To integrate Qwen Code with Scaleway's Generative APIs, you need to configure the following environment variables. You can add these lines to your
~/.bashrcor~/.zshrcfile:
export OPENAI_API_KEY="<SCW_SECRET_KEY>"
export OPENAI_BASE_URL="https://api.scaleway.ai/v1"
export OPENAI_MODEL="devstral-2-123b-instruct-2512"Alternatively to avoid conflicts with existing OpenAI API Key configuration, you can set these environment variables in a local .env file.
- Reload your terminal configuration:
source ~/.bashrc
Run and configure Qwen Code
- Open your terminal and launch Qwen Code by typing
qwen. - You will be prompted with "How would you like to authenticate for this project?". Select option 2. OpenAI.
- OpenAI configuration fields should be automatically prefilled with values you provided in environment variables. Press Enter to confirm the settings for API Key, Base URL, and Model. A message "Authenticated successfully with OpenAI credentials." should display.
- Type any prompt asking qwen-code to create or update code files.
Still need help?Create a support ticket