Try Chat Free Docs Pricing AI Analysis Repo Insights Free Tools About Blog
Sign in Get started free
< Back to blog
Tutorial Velona Team ·17 November 2026 ·5 min read

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

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 IDInput ₹ per 1MOutput ₹ per 1MOne chat replyOne agent step
Qwen3.7 Flash
qwen/qwen3.7-flash
₹3.04₹13.18₹0.01₹0.10
Qwen3 Coder Next
qwen/qwen3-coder-next
₹12.17₹81.12₹0.05₹0.45
Qwen3.8 Flash
qwen/qwen3.8-flash
₹15.21₹47.66₹0.04₹0.50
Qwen3 Coder
qwen/qwen3-coder
₹30.42₹101.39₹0.08₹1.01
Qwen3.8 27B
qwen/qwen3.8-27b
₹50.70₹304.19₹0.20₹1.83
Qwen3.8 Max
qwen/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

  1. Create an account at velona.in.
  2. Add money to the wallet with UPI. The minimum is ₹10.
  3. 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

Limitations

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.

References

  1. Puter: Qwen API pricing, full breakdown of costs
  2. DataCamp: Qwen3.8-Max, features, benchmarks and pricing
  3. Morph: Qwen API, pricing, base URL and model IDs
  4. GeoToolbox: What is Qwen3.8-Max
  5. Wikipedia: Qwen
  6. Velona: live model pricing in INR