Qwen3 Embedding 4B API: toman pricing and code

qwen/qwen3-embedding-4b

Embeddings
Input · per 1M tokens
6,924 toman
Output
Vector · not billed
Embedding 1,000 words ≈
9.00 toman

You are billed for the usage the request actually reported. Prices follow the market.Pricing and top-ups

Qwen3 Embedding 4B example: embeddings for semantic search

The example is picked from this model's own capabilities. Drop in your key and it runs as is.

curl https://api.uttapen.ir/v1/embeddings \
  -H "Authorization: Bearer sk-up-…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3-embedding-4b",
    "input": ["How long is the electric kettle warranty?", "Warranty period for kitchen appliances"]
  }'
from openai import OpenAI
import numpy as np

client = OpenAI(base_url="https://api.uttapen.ir/v1", api_key="sk-up-…")

docs = ["The electric kettle warranty is 18 months.", "Orders ship within 48 hours."]
question = "How long is the kettle guaranteed for?"

vecs = client.embeddings.create(model="qwen/qwen3-embedding-4b", input=docs + [question]).data
M = np.array([v.embedding for v in vecs])
M /= np.linalg.norm(M, axis=1, keepdims=True)
scores = M[:-1] @ M[-1]
print(docs[int(scores.argmax())])
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.uttapen.ir/v1", apiKey: "sk-up-…" });

const docs = ["The electric kettle warranty is 18 months.", "Orders ship within 48 hours."];
const { data } = await client.embeddings.create({ model: "qwen/qwen3-embedding-4b", input: [...docs, "How long is the kettle guaranteed for?"] });

const norm = (v) => { const n = Math.hypot(...v); return v.map((x) => x / n); };
const vecs = data.map((d) => norm(d.embedding));
const q = vecs.at(-1);
const dot = (a, b) => a.reduce((s, x, i) => s + x * b[i], 0);
const best = vecs.slice(0, -1).map((v, i) => [dot(v, q), i]).sort((a, b) => b[0] - a[0])[0][1];
console.log(docs[best]);

What is Qwen3 Embedding 4B good for?

"qwen/qwen3-embedding-4b" is Qwen (Alibaba)'s vector model. The output is a list of numbers, which makes it a building block for semantic search, RAG and clustering, served on /v1/embeddings. Each input can hold up to 32,768 tokens, so large chunks embed without being cut. Of the 35 paid embedding models in the catalogue, 15 cost less per input token.

It is multilingual, which matters for Persian text; still, measure it on a few dozen real questions against your own documents before committing.

Only input tokens are billed. Indexing a thousand 500-token documents (500k tokens) costs about 3,462.19 toman here; the vectors are built once and afterwards only queries cost anything. For an alternative at a similar price, look at Titan Text Embeddings V2 from Amazon.

Provider's own description

The Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. This series inherits the exceptional multilingual capabilities, long-text...

Three real jobs, priced on this model

Each figure is derived from the prices above and moves when they do.

JobTokensCost
One user search query30 in0.21 toman
Indexing 10,000 product titles300,000 in2,077.32 toman
Indexing 1,000 documents of 500 tokens500,000 in3,462.19 toman

Frequently asked

How do I get vectors from Qwen3 Embedding 4B?
Create an API key, point the official OpenAI SDK's base_url at https://api.uttapen.ir/v1 and call client.embeddings.create with model "qwen/qwen3-embedding-4b" and an input string or list of strings. Each input comes back as one vector in data.
What does Qwen3 Embedding 4B cost in toman?
6,924 toman per 1M input tokens, and output is free. You pay for the input tokens the request reported; a failed request costs nothing.
Can I use Qwen3 Embedding 4B for chat?
No. An embedding model writes no text, so chat/completions with it returns 400. For RAG, build the vectors here and let a chat model write the answer.