from openai import OpenAIclient = OpenAI( base_url="https://gateway.vlm.run/openai", api_key="<VLMRUN_API_KEY>",)response = client.embeddings.create( model="qwen/qwen3-vl-embedding-2b", input="Extract a vector representation for this text.",)print(len(response.data[0].embedding))
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://gateway.vlm.run/openai", apiKey: process.env.VLMRUN_API_KEY,});const response = await client.embeddings.create({ model: "qwen/qwen3-vl-embedding-2b", input: "Extract a vector representation for this text.",});console.log(response.data[0].embedding.length);
vlmrun gw embed -t "Extract a vector representation for this text." \ -m qwen/qwen3-vl-embedding-2b
curl https://gateway.vlm.run/openai/embeddings \ -X POST \ -H "Authorization: Bearer $VLMRUN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3-vl-embedding-2b", "input": "Extract a vector representation for this text." }'
OpenAI-compatible text, image, video, audio, and PDF inputs
POST
/
openai
/
embeddings
from openai import OpenAIclient = OpenAI( base_url="https://gateway.vlm.run/openai", api_key="<VLMRUN_API_KEY>",)response = client.embeddings.create( model="qwen/qwen3-vl-embedding-2b", input="Extract a vector representation for this text.",)print(len(response.data[0].embedding))
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://gateway.vlm.run/openai", apiKey: process.env.VLMRUN_API_KEY,});const response = await client.embeddings.create({ model: "qwen/qwen3-vl-embedding-2b", input: "Extract a vector representation for this text.",});console.log(response.data[0].embedding.length);
vlmrun gw embed -t "Extract a vector representation for this text." \ -m qwen/qwen3-vl-embedding-2b
curl https://gateway.vlm.run/openai/embeddings \ -X POST \ -H "Authorization: Bearer $VLMRUN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3-vl-embedding-2b", "input": "Extract a vector representation for this text." }'
Omit the Authorization header for anonymous access.Per-tier quotas are on Rate Limits. This route shares those quotas with chat completions.Model ids are on Models.
from openai import OpenAIclient = OpenAI( base_url="https://gateway.vlm.run/openai", api_key="<VLMRUN_API_KEY>",)response = client.embeddings.create( model="qwen/qwen3-vl-embedding-2b", input="Extract a vector representation for this text.",)print(len(response.data[0].embedding))
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://gateway.vlm.run/openai", apiKey: process.env.VLMRUN_API_KEY,});const response = await client.embeddings.create({ model: "qwen/qwen3-vl-embedding-2b", input: "Extract a vector representation for this text.",});console.log(response.data[0].embedding.length);
vlmrun gw embed -t "Extract a vector representation for this text." \ -m qwen/qwen3-vl-embedding-2b
curl https://gateway.vlm.run/openai/embeddings \ -X POST \ -H "Authorization: Bearer $VLMRUN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3-vl-embedding-2b", "input": "Extract a vector representation for this text." }'
qwen/qwen3-vl-embedding-2b accepts image_url content parts in input. A video_url part on this model is a 400.google/embeddinggemma-2 accepts image_url and video_url parts. video_url embeds sampled frames.Image and video vectors share the text vector space.google/embeddinggemma-2 also accepts audio_url, input_audio, and document_url parts. A PDF’s pages pool into one vector. All parts in one input share one 8,192-token window.Check capabilities.supported_input_types on GET /openai/models before using a modality.Not every embedding model accepts images or video.
google/embeddinggemma-2 is trained with a short prefix on text inputs. Set it with prompt_name. The default is Classification. A wrong prefix still returns a vector, at lower precision. An unknown name is a 400.
prompt_name
Task
Pair with
SearchQuery
Web and document search
Document
QuestionAnswering
Question answering
Document
FactChecking
Fact checking
Document
CodeRetrieval
Code search
Document
Classification
Text classification
itself
Clustering
Clustering
itself
SentenceSimilarity
Semantic similarity
itself
dimensions takes 768, 512, 256, or 128. The shorter vector is re-normalized. Queries and documents must share one value.
from openai import OpenAIclient = OpenAI( base_url="https://gateway.vlm.run/openai", api_key="<VLMRUN_API_KEY>",)response = client.embeddings.create( model="google/embeddinggemma-2", input="What causes the northern lights?", dimensions=256, extra_body={"prompt_name": "SearchQuery"},)print(len(response.data[0].embedding))
A 200 debits your organization by usage.cost. The cost is usage.prompt_tokens multiplied by the model’s prompt price per 1M tokens, rounded to six decimals. Embeddings have no per-call minimum, so a short text input can show "cost": 0.0, as in the examples above.On google/embeddinggemma-2, media counts as prompt tokens at fixed rates:
Input
Prompt tokens
Image, or one PDF page
280
Video frame
140
Audio second
25
For example, 1,000 images cost 280,000 tokens, which is $0.0028 at $0.01 per 1M tokens. Prices per model are on Models.A free-plan organization with a negative balance, or an organization with an overdue payment, gets a 402, as on chat completions. Calls without an API key count toward the same daily anonymous spend cap as chat.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
OpenAI-compatible embeddings request.
The input field is intentionally polymorphic to match both
OpenAI's API (string / list-of-strings / list-of-token-ids) and
vLLM's multimodal extension (list of content parts). The router
normalises everything to a list of items before handing it to the
backend, so individual backends only see one shape.