Qwen API guide

Qwen API access and providers

Start with Alibaba Cloud Model Studio, then choose the exact region, API key, protocol and provider route that your application will use.

Official route baseline

DECLARED

Alibaba Cloud Model Studio lists Qwen models across regional services and exposes OpenAI-compatible, Anthropic-compatible and DashScope interfaces. The API Host and key are tied to the selected region and workspace.

About “free Qwen API”

New-user free quota is not universal. Official documentation limits it to eligible models in the Singapore region with an International deployment scope, with validity and remaining quota shown in the console.

Check current free-quota rules ↗

API key setup

Create the key in the route you will call.

  1. 01

    Choose a Model Studio region

    Select the region and deployment scope that match the Qwen model, account eligibility, latency and data requirements.

  2. 02

    Create the regional API key

    Create a key in that region's Model Studio workspace. The console shows the key and API Host; save the plaintext key immediately.

  3. 03

    Use the matching endpoint

    Model Studio exposes OpenAI-compatible, Anthropic-compatible and DashScope interfaces. Base URLs vary by region and protocol.

  4. 04

    Lock down access

    Use workspace permissions, model scope and IP allowlists where supported. Never expose the key in browser code or a public repository.

Regional endpoint rule

Copy the API Host from the key-creation confirmation or the current model page. Do not reuse a Beijing, Singapore, Tokyo, Frankfurt or Virginia base URL interchangeably; protocol and region both change the endpoint.

Access routes

Official API, provider, gateway or self-host

Qwen is the model family. The company receiving the request is determined by the route you configure.

Official managed route

Alibaba Cloud Model Studio

The primary cloud platform route for Qwen APIs, regional endpoints, workspace keys, quotas and enterprise controls.

Provider route

Third-party inference provider

A separate company hosts Qwen weights or routes the request. Verify model ID, quantization, context, tools and data handling.

Routing layer

Gateway or aggregator

A gateway can select or fail over between inference providers. Identify the downstream provider before making trust claims.

Private deployment

Self-hosted Qwen

Run compatible open weights in your infrastructure. Your team owns capacity, runtime security, upgrades and model-serving operations.

Enterprise and provider review

Approve the deployment path, not just Qwen.

The same Qwen weights can sit behind different clouds, providers and contracts. The model label does not answer where prompts are processed.

Verify provider route ↗
  • Region and deployment scope
  • Workspace ownership and API key custody
  • IP allowlist and model-level permissions
  • Prompt, file and response data path
  • Retention, logging and training-use terms
  • DPA, SLA and subprocessor evidence

Coding workflow

Qwen Code is a separate client choice.

The open-source terminal agent supports multiple API protocols and providers. Its former OAuth free tier has been discontinued, so choose an active Coding Plan, provider or API key route.

Open Qwen Code ↗