For the complete documentation index, see llms.txt. This page is also available as Markdown.

Embeddings

TensorX serves text embeddings through the standard OpenAI-compatible /v1/embeddings endpoint. One embedding model is available:

Model
Output dimensions
Max input
Pricing

qwen/qwen3-embedding-8b

4096 (fixed)

40,960 tokens

See tensorx.ai/models

Basic usage

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.tensorx.ai/v1"
)

resp = client.embeddings.create(
    model="qwen/qwen3-embedding-8b",
    input="The capital of France is Paris."
)

vector = resp.data[0].embedding   # list of 4096 floats

Batch inputs by passing a list. Each item gets its own vector, returned in the same order:

resp = client.embeddings.create(
    model="qwen/qwen3-embedding-8b",
    input=["first document", "second document", "third document"]
)
vectors = [d.embedding for d in resp.data]

Input limit

The model context length is 40,960 tokens. Requests above this are rejected; nothing is truncated for you.

For RAG or document indexing, chunk your text to well under 40,960 tokens per item before sending. Chunks of 512 to 1,024 tokens are typical for retrieval.

The dimensions parameter is not supported

OpenAI's text-embedding-3 models accept a dimensions parameter to shorten the output vector. Some client libraries and tools (for example Cherry Studio, and some Open WebUI setups) send it automatically.

qwen/qwen3-embedding-8b does not accept dimensions. Sending it fails the request. If your tool sets dimensions automatically, turn that option off. The model always returns the full 4096-dimensional vector.

Need smaller vectors? Qwen3-Embedding uses Matryoshka Representation Learning, so you can shorten the vector yourself: request the full 4096-dim embedding, keep the first N values, then re-normalise (L2). Normalising after truncation is what preserves quality.

Errors

All of the cases below return the same generic response:

The API does not tell you which of these caused it, so check them in order:

Cause
What to change

Sent a dimensions parameter

Remove it; truncate client-side (see above)

Input over 40,960 tokens

Chunk the input to smaller pieces

Blank or whitespace-only item in a batch

Filter empty inputs before sending

See Also

Last updated

Was this helpful?