Skip to main content
POST
/
v1
/
openai
/
embeddings
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.vlm.run/v1/openai",
    api_key="<VLMRUN_API_KEY>",
)

response = client.embeddings.create(
    model="<embedding-model-id>",
    input="Extract a vector representation for this text.",
)

print(len(response.data[0].embedding))
{
  "model": "<string>",
  "data": [
    {
      "index": 123,
      "embedding": [
        123
      ],
      "object": "embedding"
    }
  ],
  "id": "<string>",
  "object": "list",
  "created": 123,
  "served_model_id": "<string>",
  "backend": "<string>",
  "usage": {
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}
Authentication is optional. See Rate Limits for per-tier quotas. For available embedding models, see Models.
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.vlm.run/v1/openai",
    api_key="<VLMRUN_API_KEY>",
)

response = client.embeddings.create(
    model="<embedding-model-id>",
    input="Extract a vector representation for this text.",
)

print(len(response.data[0].embedding))

Authorizations

Authorization
string
header
required

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.

model
string
required
input
required
encoding_format
enum<string>
default:float
Available options:
float,
base64
dimensions
integer | null
user
string | null
truncate_prompt_tokens
integer | null

Response

Successful Response

OpenAI-compatible embeddings response with vlmrt audit extras.

model
string
required
data
EmbeddingData · object[]
required
id
string
object
string
default:list
Allowed value: "list"
created
integer
served_model_id
string | null
backend
string | null
usage
EmbeddingUsage · object