paraphrase-MiniLM-L6-v2 API: toman pricing and code

sentence-transformers/paraphrase-minilm-l6-v2

Embeddings
Input · per 1M tokens
1,731 toman
Output
Vector · not billed
Embedding 1,000 words ≈
2.25 toman

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

paraphrase-MiniLM-L6-v2 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": "sentence-transformers/paraphrase-minilm-l6-v2",
    "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="sentence-transformers/paraphrase-minilm-l6-v2", 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: "sentence-transformers/paraphrase-minilm-l6-v2", 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 paraphrase-MiniLM-L6-v2 good for?

paraphrase-MiniLM-L6-v2 is an embedding model from Sentence Transformers: it turns text into a vector rather than writing a reply. Call it as "sentence-transformers/paraphrase-minilm-l6-v2" on POST /v1/embeddings — it does not answer chat requests. Each input is capped at 512 tokens — short text such as a product title, a query or a paragraph — so chunk long documents first. Of the 35 paid embedding models in the catalogue, 1 cost less per input token.

It was trained mainly on English; for Persian documents pick a multilingual model and keep this one for English data.

Only input tokens are billed. Indexing a thousand 500-token documents (500k tokens) costs about 865.55 toman here; the vectors are built once and afterwards only queries cost anything. For an alternative at a similar price, look at bge-base-en-v1.5 from BAAI.

Provider's own description

The paraphrase-MiniLM-L6-v2 embedding model converts sentences and short paragraphs into a 384-dimensional dense vector space, producing high-quality semantic embeddings optimized for paraphrase detection, semantic similarity scoring, clustering, and lightweight retrieval...

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.05 toman
Indexing 10,000 product titles300,000 in519.33 toman
Indexing 1,000 documents of 500 tokens500,000 in865.55 toman

Frequently asked

How do I get vectors from paraphrase-MiniLM-L6-v2?
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 "sentence-transformers/paraphrase-minilm-l6-v2" and an input string or list of strings. Each input comes back as one vector in data.
What does paraphrase-MiniLM-L6-v2 cost in toman?
1,731 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 paraphrase-MiniLM-L6-v2 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.