Get started in a few minutes
Set up your account and make your first API call to Qwen models.
Prerequisites
1
Create an account
Go to Qwen Cloud and sign in with GitHub or email.
2
Get your API key
Navigate to API Keys, click Add API Key, and copy your key (starts with
sk-). Detailed guide →Keep your API key secret! Never commit it to version control or share it publicly.
3
Set your environment variable
Store your API key so your code can access it:For permanent setup across sessions, see Configure your API key →.
Make your first call
- Python
- Node.js
- curl
Install the OpenAI SDK:Create a file Run it:
hello_qwen.py:For Java, Go, PHP, C#, and other languages, use the OpenAI-compatible endpoint shown in the curl tab with your language's HTTP client. For Java, you can also use the DashScope Java SDK.
What's next?
- Text generation guide — Streaming, function calling, and more
- Vision models — Analyze images and videos
- Model selection — Choose the right model for your use case
- Try AI — Try models interactively