Inference APIs
Models/Embedding/Qwen3 Embedding 8B
EmbeddingsMultilingualAdjustable dimensions32K input
Max input
32K tokens
Dimensions
4,096 (adjustable)
Modality
Text → Vector
Price
$0.02 / 1M input tokens
Model ID
Qwen/Qwen3-Embedding-8B

Quickstart

You need an API key to call this model. Create a free account or log in.

Set INFERENCE_API_KEY to your key from the API Keys page, then run:

curl https://api.inferenceapis.com/v1/embeddings \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-Embedding-8B",
    "input": ["The cat sat on the mat.", "Le chat est sur le tapis."],
    "dimensions": 1024
  }'
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inferenceapis.com/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
)

resp = client.embeddings.create(
    model="Qwen/Qwen3-Embedding-8B",
    input=["The cat sat on the mat.", "Le chat est sur le tapis."],
    dimensions=1024,
)
vectors = [d.embedding for d in resp.data]
print(len(vectors), len(vectors[0]), resp.usage.total_tokens)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.inferenceapis.com/v1",
  apiKey: process.env.INFERENCE_API_KEY,
});

const resp = await client.embeddings.create({
  model: "Qwen/Qwen3-Embedding-8B",
  input: ["The cat sat on the mat.", "Le chat est sur le tapis."],
});
console.log(resp.data.length, resp.data[0].embedding.length, resp.usage.total_tokens);

When to use it

A good fit when
  • You want to choose the vector size: the dimensions parameter shortens vectors from 4,096 down
  • Long inputs up to 32K tokens
Look elsewhere when
  • Storage is tight and you will not shorten the vectors; 4,096 floats per text adds up

What it costs in practice

WorkloadCost
Index 10,000 documents of 500 tokens$0.10
Index 1 million documents of 500 tokens$10.00
1 million search queries of 20 tokens$0.40

Computed from the live rate below. There is no subscription or minimum; new accounts start with free credit.

Endpoint

POST https://api.inferenceapis.com/v1/embeddings
Headers Authorization: Bearer $INFERENCE_API_KEY
Content-Type: application/json
Compatible OpenAI wire format. /openai/v1/… is accepted too, so Groq-style base URLs work with only the host changed.

Model IDs and aliases

Send any of these as model; they all resolve to this model and bill at its rate.

IDNote
Qwen/Qwen3-Embedding-8BCanonical
qwen3-embedding-8bAlias

Request body

ParameterTypeDescription
model required string Model ID: Qwen/Qwen3-Embedding-8B — also accepted: qwen3-embedding-8b
input required string | array One text or an array of up to 1,024 texts. Each text can be up to 32K tokens.
dimensions integer Shorten the vectors (for example 1024 or 512). This model is trained so that the leading dimensions carry the most information.
encoding_format string float (default) or base64.

Response

200 OK · application/json
{
  "object": "list",
  "model": "Qwen/Qwen3-Embedding-8B",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, ...] },
    { "object": "embedding", "index": 1, "embedding": [0.0119, -0.0431, ...] }
  ],
  "usage": { "prompt_tokens": 17, "total_tokens": 17 }
}

Pricing

Price$0.02 / 1M input tokens
BillingPay as you go from prepaid credits. No subscription, no daily request or token cap. See all pricing.

Notes

  • Vectors from different embedding models, or of different lengths, are not comparable. Pick a dimension count once per index.

Errors

Errors use the OpenAI envelope: {"error": {"message", "type", "code"}}. 401 missing or invalid key · 402 insufficient_balance · 404 model_not_found · 503 model_unavailable · 502 backend error, safe to retry. Full table with what to retry: API documentation. Errors from other providers: provider error reference.