---
title: Integrating Qwen Code with Scaleway's Generative APIs
description: Learn how to integrate Qwen Code with Scaleway's Generative APIs for AI-powered coding assistance.
tags: generative-apis ai machine-learning language-models code-assistance qwen-code scaleway
dates:
  validation: 2025-09-22
  posted: 2025-09-22
---
import Requirements from '@macros/iam/requirements.mdx'

Qwen Code is a coding agent for terminal and IDE. You can integrate Scaleway's Generative APIs models to Qwen Code.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A valid [API key](/iam/how-to/create-api-keys/) for API authentication
- Installed [Qwen Code](https://github.com/QwenLM/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:

    ```bash
    export OPENAI_API_KEY="<SCW_SECRET_KEY>"
    export OPENAI_BASE_URL="https://api.scaleway.ai/v1"
    export OPENAI_MODEL="qwen3.5-397b-a17b"
    ```
    Alternatively to avoid conflicts with existing OpenAI API Key configuration, you can set these environment variables in a local `.env` file.

    <Message type="note">
      On Windows, configure the environment variables using the system settings instead of `.bashrc`.
    </Message>

2. Reload your terminal configuration:
    ```bash
    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.
