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.

Product basicsOfficial source

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

  1. 01Register or confirm the Alibaba Cloud account.
  2. 02Activate Model Studio and accept the service agreement.
  3. 03Create an API key in the correct region.
  4. 04Install the OpenAI SDK or prepare curl.
  5. 05Run a simple chat completion request.
  6. 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

Scroll
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

Scroll
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