Qwen API Python Guide for India: Qwen3.8 Max, Flash and Coder Prices in ₹, With UPI Billing (2026)
You can call Alibaba's Qwen models from Python in India with the standard OpenAI SDK and a UPI funded key. On Velona, Qwen3.8 Max costs ₹202.79 per 1M input tokens and ₹608.37 per 1M output tokens. Qwen3.8 Flash costs ₹15.21 and ₹47.66.[6] Alibaba's own list prices are $2 and $6 for Max, and $0.15 and $0.47 for Flash.[1]
Key facts
- Qwen3.8 Max is Alibaba's current flagship. Its cloud version was released on 3 August 2026.[1][5]
- It has 2.4 trillion parameters and a 1 million token context window. An updated version, Qwen3.8 Max 0902, followed on 2 September 2026 at the same price.[2]
- Alibaba states that thinking content is billed as output tokens.[3]
- Qwen prices span a wide range, from $0.03 per 1M input tokens on Qwen3.7 Flash to $2 on Qwen3.8 Max.[1]
Scope and sources
Model facts and Alibaba list prices come from four guides that cite Alibaba Cloud Model Studio pricing and the Qwen launch post.[1][2][3][4] Rupee prices are from the Velona catalogue on 14 November 2026.[6] A chat reply is counted as 1,000 input and 500 output tokens, and an agent step as 30,000 input and 1,000 output tokens, with no caching. The code uses the OpenAI Python SDK against Velona's OpenAI compatible endpoint.
Qwen prices in rupees
| Model and Velona ID | Input ₹ per 1M | Output ₹ per 1M | One chat reply | One agent step |
|---|---|---|---|---|
Qwen3.7 Flashqwen/qwen3.7-flash | ₹3.04 | ₹13.18 | ₹0.01 | ₹0.10 |
Qwen3 Coder Nextqwen/qwen3-coder-next | ₹12.17 | ₹81.12 | ₹0.05 | ₹0.45 |
Qwen3.8 Flashqwen/qwen3.8-flash | ₹15.21 | ₹47.66 | ₹0.04 | ₹0.50 |
Qwen3 Coderqwen/qwen3-coder | ₹30.42 | ₹101.39 | ₹0.08 | ₹1.01 |
Qwen3.8 27Bqwen/qwen3.8-27b | ₹50.70 | ₹304.19 | ₹0.20 | ₹1.83 |
Qwen3.8 Maxqwen/qwen3.8-max-0902 | ₹202.79 | ₹608.37 | ₹0.51 | ₹6.69 |
Source: Velona catalogue, 14 November 2026.[6] Rupee prices follow the live exchange rate.
Which Qwen model to pick
What is the job?
|
+-- Bulk classification or extraction ...... Qwen3.7 Flash
+-- Everyday chat and summaries ............ Qwen3.8 Flash
+-- Coding agent on a budget ............... Qwen3 Coder Next or Qwen3 Coder
+-- Hard coding and long agent runs ........ Qwen3.8 Max
Alibaba positions Qwen3.8 Max for coding and long horizon agent work.[1] Its output price of $6 per 1M tokens is lower than the $10 charged by several models with the same $2 input price, which matters for tasks that write long answers.[1][6]
Step 1: get a key
- Create an account at velona.in.
- Add money to the wallet with UPI. The minimum is ₹10.
- Create an API key and set a budget on it.
Step 2: install and configure
pip install openai python-dotenv
Put the key in a .env file and keep that file out of Git.
VELONA_API_KEY=your_key_here
Step 3: first request
import os
from dotenv import load_dotenv
from openai import OpenAI
load_dotenv()
client = OpenAI(
api_key=os.environ["VELONA_API_KEY"],
base_url="https://velona.in/v1",
)
response = client.chat.completions.create(
model="qwen/qwen3.8-flash",
messages=[
{"role": "system", "content": "You are a concise coding assistant."},
{"role": "user", "content": "Write a Python function that checks if a string is a valid UPI ID."},
],
max_tokens=400,
)
print(response.choices[0].message.content)
print(response.usage)
max_tokens caps the output, which is the expensive side of the bill. response.usage shows the tokens you were charged for.
Step 4: streaming
stream = client.chat.completions.create(
model="qwen/qwen3.8-flash",
messages=[{"role": "user", "content": "Explain list comprehensions with two examples."}],
max_tokens=400,
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
print()
Step 5: handle errors and retries
import time
from openai import APIConnectionError, APIStatusError, RateLimitError
def ask(prompt, model="qwen/qwen3.8-flash", retries=3):
for attempt in range(retries):
try:
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": prompt}],
max_tokens=400,
)
return r.choices[0].message.content
except (RateLimitError, APIConnectionError):
time.sleep(2 ** attempt)
except APIStatusError as e:
raise RuntimeError(f"Request failed with status {e.status_code}") from e
raise RuntimeError("Gave up after retries")
print(ask("Give three test cases for a function that parses Indian phone numbers."))
The function retries on rate limits and network errors with a growing delay, and stops at once on other errors such as an empty wallet or a wrong model ID.
Step 6: switch models with one line
hard_answer = ask(
"Find the race condition in this code and propose a fix: ...",
model="qwen/qwen3.8-max-0902",
)
A common pattern is to send routine prompts to a Flash model and only the difficult ones to Max. The same key and the same code work for both.
Three cost rules for Qwen
- Thinking is billed as output. Alibaba's documentation says reasoning text counts at the output rate, even though the user does not see it.[3]
- Open weights exist for some models. Alibaba released open weights for the flagship in August 2026 under its own licence, with a smaller Qwen3.8 27B model alongside.[4] Running them yourself needs serious hardware. See local AI vs cloud AI for coding in India.
- Caching lowers repeated input. Alibaba lists implicit caching for Qwen3.8 Max at $0.25 per 1M tokens.[2] The costs in this guide assume no caching.
Limitations
- Alibaba's dollar prices come from guides that cite its pricing page, not from a capture of that page by us.
- Request sizes are examples and not measured averages.
- This guide does not rank Qwen against other models on quality.
Frequently asked questions
How do I get a Qwen API key in India?
Create a Velona account, top up with UPI and create a key. The same key calls every Qwen model in the catalogue.[6]
How much does the Qwen API cost in rupees?
From ₹3.04 per 1M input tokens on Qwen3.7 Flash to ₹202.79 on Qwen3.8 Max at Velona prices.[6]
Is the Qwen API compatible with the OpenAI SDK?
Yes. Alibaba offers an OpenAI compatible endpoint, and so does Velona.[3] The code above uses the OpenAI Python SDK unchanged.
Which Qwen model is best for coding?
Alibaba positions Qwen3.8 Max for coding and agent work.[1] Qwen3 Coder models cost much less per step and are a sensible first try.
Disclosure: Velona publishes this guide and sells access to these models. Prices were checked on 14 November 2026.