
Qwen is a family of models from Alibaba. To call them from code you need an API key. There are two ways to get one: directly from Alibaba Cloud, or through llmbox, where one key gives access to models from different vendors. Both options are described below.
Option 1. A key directly from Alibaba Cloud
The official console is called Alibaba Cloud Model Studio. You create a key on the API Key page: click "Create API Key", then choose a workspace and permissions. According to Alibaba, the full key is shown only once, so save it right away. You need an Alibaba Cloud account and payment set up. The steps are in the official documentation: How to obtain an API key.
Such a key works with the Alibaba API. Models from other vendors need separate accounts and keys.
Option 2. One llmbox key
In llmbox you create a key in the cabinet, and it works with every model in the catalog, Qwen included. You pay from your balance based on actual usage, and requests are sent in the OpenAI format.
- Create an account
Sign up for llmbox. You can confirm your email later in the cabinet.
- Top up your balance
Open the Balance section in the cabinet.
- Create a key
Open the Keys section in the cabinet. You can copy the key at any time with the "Show key" button.
- Choose a Qwen model
For example,
qwen/qwen3.8-flash. All of the vendor's models are on the Qwen page.
The API address is https://llmbox.cc/v1. Save the key in an environment variable:
export LLMBOX_API_KEY="sk-your-key"
A Python example with the official openai SDK:
import os
from openai import OpenAI
client = OpenAI(base_url="https://llmbox.cc/v1", api_key=os.environ["LLMBOX_API_KEY"])
resp = client.chat.completions.create(
model="qwen/qwen3.8-flash",
messages=[{"role": "user", "content": "Hello! Reply in one sentence."}],
)
print(resp.choices[0].message.content)
A curl example:
curl https://llmbox.cc/v1/chat/completions \
-H "Authorization: Bearer $LLMBOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen/qwen3.8-flash","messages":[{"role":"user","content":"Hello!"}]}'
Which Qwen model to choose
Qwen3.8 Flash is built for coding assistance and agent scenarios under high load, and Qwen3.8 Max for the most demanding tasks. Both models have a 1M-token context window. The other models in the family and how they differ are on the Qwen page.
Estimate usage in advance.
Which option to choose
A direct key makes sense if you only work with Qwen within the Alibaba Cloud ecosystem. An llmbox key is convenient when you use several models: one key, one API address and one balance, and to pick a model you only change the model string. For more, see Quickstart, Keys and authentication and OpenAI and ElevenLabs SDKs in the documentation. Setup for Codex CLI, Cursor, OpenCode and other programs is described in the Integrations overview.
Key security
Keep the key in environment variables and don't publish it in a repository. If the key falls into the wrong hands, create a new one in the cabinet and replace it in your applications.
Questions
Where are Qwen keys officially issued?
In Alibaba Cloud Model Studio: you create a key on the API Key page of the console. The steps are in the official Alibaba Cloud documentation.
Do I need a separate Alibaba key if I have an llmbox key?
No. The Qwen models in the catalog work with the same llmbox key as all other models. In the request you set an identifier such as qwen/qwen3.8-flash.
Can I use Qwen from tools like Codex CLI?
Yes. Qwen models in llmbox work in the Chat Completions and Responses formats, so they suit Codex CLI, Cursor and OpenCode. The settings are described in the documentation, in the Integrations overview, and on the tool pages.
Published November 15, 2026


