Qwen 3 Embedding 4B qwen3-embedding-4b
Multilingual text embedding model with truncatable dimensions for retrieval and RAG. Input longer than the context length is rejected with a 400 (context_length_exceeded).
Tokens
$0.05 / 1M tokens
Context
32K tokens
Inputs
| Input | Accepts |
|---|---|
text | context 32K tokens |
Parameters
| Parameter | Type | Values | Default |
|---|---|---|---|
encoding_format | string | float, base64 | |
dimensions | integer | at least 1 | |
input_type | string | search_query, search_document |
Endpoints
A request
curl https://api.vultrinference.com/v1/embeddings \
-H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-embedding-4b",
"input": [
"What is the capital of France?"
],
"input_type": "search_query"
}'import os
import requests
response = requests.post(
"https://api.vultrinference.com/v1/embeddings",
headers={"Authorization": f"Bearer {os.environ['VULTR_INFERENCE_API_KEY']}"},
json={
"model": "qwen3-embedding-4b",
"input": [
"What is the capital of France?",
],
"input_type": "search_query",
},
)
print(response.json())const response = await fetch("https://api.vultrinference.com/v1/embeddings", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VULTR_INFERENCE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "qwen3-embedding-4b",
"input": [
"What is the capital of France?"
],
"input_type": "search_query"
}),
});
console.log(await response.json());