Quick start
First Qwen API Call
A first API call needs an activated account, Model Studio API key, region-specific base URL, OpenAI SDK or HTTP client, and a model that is available in the chosen region.
Who this is for
Developers who need a minimal working request before production setup.
Configuration reference
Values to confirm before setup
Environment variable
DASHSCOPE_API_KEY
Example SDK Base URL
https://dashscope-intl.aliyuncs.com/compatible-mode/v1
Example model
qwen3.7-plus, qwen3.6-plus, or another supported model for the selected region
Setup flow
Practical steps
- 01Register or confirm the Alibaba Cloud account.
- 02Activate Model Studio and accept the service agreement.
- 03Create an API key in the correct region.
- 04Install the OpenAI SDK or prepare curl.
- 05Run a simple chat completion request.
- 06Check token usage and errors before sharing credentials with a team.
Preflight checks
Make sure the buyer has the right account owner, billing method, and region. If the customer wants US or EU data routing, do not test with a Singapore-only key and call it production ready.
What to record after the first call
Record model name, endpoint, key owner, response latency, token usage, error codes, and whether streaming is enabled. This becomes the handoff note for the customer's developer.
Examples
Copy the structure, not the secrets
Python smoke test
python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[{"role": "user", "content": "Reply with one short setup checklist."}],
)
print(response.choices[0].message.content)curl smoke test
bash
curl -X POST "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3.7-plus","messages":[{"role":"user","content":"Say ready."}]}'Common mistakes
Check these before escalating
- Wrong region keys are a common failure source.
- Never put the API key into client-side browser code.
- The first successful call does not prove production quota is sufficient.
Related guides
OpenAI-Compatible Chat API
Most OpenAI-compatible integrations need only three changes: API key, base URL, and model name. The hard part is choosing the correct plan and endpoint.
Regions and Deployment Modes
Model Studio endpoints, API keys, data routing, and model availability depend on the deployment mode. A quote must specify the intended region before payment.
Rate Limits and Quota Errors
Rate limits are calculated by account, model, and aggregate API-key usage. A customer quote should include traffic assumptions and an escalation path.
Usage Monitoring and Cost Control
Production buyers need visibility into call volume, token consumption, success rate, quota remaining, and monthly replenishment.