Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

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

  1. To integrate Qwen Code with Scaleway's Generative APIs, you need to configure the following environment variables. You can add these lines to your ~/.bashrc or ~/.zshrc file:
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.

Note

On Windows, configure the environment variables using the system settings instead of .bashrc.

  1. Reload your terminal configuration:
    source ~/.bashrc

Run and configure Qwen Code

  1. Open your terminal and launch Qwen Code by typing qwen.
  2. You will be prompted with "How would you like to authenticate for this project?". Select option 2. OpenAI.
  3. 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.
  4. Type any prompt asking qwen-code to create or update code files.
Still need help?

Create a support ticket
No Results