POST /ai/v2/direct/embeddings serves every embedding model in the Gloo catalog (OpenAI, Google, Voyage AI, Mistral, Qwen, BAAI and more) behind one request shape. The request and response mirror the OpenAI Embeddings API, so the OpenAI SDKs work by pointing the base URL at Gloo.
You don’t need this endpoint to search content you have uploaded to Gloo. The Data Engine embeds your content for you, and Search and the grounded endpoints query it. Use Embeddings when you run your own vector store.
Quick start
URL:https://platform.ai.gloo.com/ai/v2/direct/embeddings
Operation: POST
With the OpenAI SDK
Request format
Sendmodel (an embedding model’s Gloo Model ID; see Choosing a model) and input (one non-empty string, or an array of 1 to 2048). Optional encoding_format (float or base64) follows OpenAI’s API; if omitted, the provider’s default applies, so set it when your client needs a particular encoding. Optional dimensions shortens the vector, but support varies by model and an unsupported value returns 400; see Dimension support. For every field, see the Embeddings API reference.
Provider-specific parameters are forwarded to the model provider unless Gloo reserves or rejects them. stream and provider are not forwarded. The aliases dimension, output_dimension, and output_dimensionality return 400; use dimensions instead.
Input rules:
- Each string must fit within the model’s input limit (
max_input_tokensin the catalog, which is as low as 512 tokens for some models). A longer string is rejected with a400, so split long documents into chunks first; Building a Knowledge Base covers how. - Arrays of token IDs, which the OpenAI API also accepts, are not supported. Send text.
- Empty or whitespace-only strings are rejected.
Response format
data holds one embedding per input string, in the same order as input.
embedding is the provider’s vector passed through untouched. If a provider does not honor a requested encoding, Gloo returns 503 instead of a response in the wrong shape. usage may be omitted when the provider does not report usable usage; requests without usage are not billed.
Choosing a model
Every model whoseoutput_modalities includes embeddings works here, and sending a chat model returns a 400 that says so. Supported Models identifies embedding models and lists each model’s input price, vector width, and input limit. To list only embedding models, filter the public catalog:
- Stay on one model. Vectors from different models, or from the same model with different
dimensions, are not comparable. Embed your documents and your queries with the same model and settings, and re-embed everything if you switch. - Vector size differs by model. For example,
gloo-openai-text-embedding-3-smallreturns 1536 numbers andgloo-baai-bge-base-en-v1.5returns 768. Size your vector store’s column to the model you pick.
Dimension support
Only some embedding models acceptdimensions. For example, the OpenAI text-embedding-3 models accept widths up to their native size, Perplexity models require at least 128, and Voyage models accept 256, 512, 1024, or 2048. Other models reject this parameter with 400. The public model catalog reports native vector width, but does not currently list which shortened widths a model accepts. A 400 response identifies the accepted values or range when available.
What runs, and what doesn’t
This is a direct endpoint. Authentication, organization entitlement, usage metering, and platform rate limits apply. Guardrails and moderation do not run, and embeddings do not use automatic model routing or streaming. Your text goes to the embedding model you name. Embeddings requests are not failed over to a second provider. A provider outage or rate limit returns503 with retryable: true; retry with bounded exponential backoff. Gloo also returns 503 if the provider returns an empty, incomplete, unusable, or incorrectly encoded vector batch. If the same request repeatedly fails because the provider does not support a requested encoding, change the request or model instead of retrying unchanged.
Pricing
Embeddings are billed per input token at the model’s published input rate. There is no output charge; see Pricing. Live rates are on Supported Models andGET /platform/v2/models; your spend shows up in API usage.
Errors
The full list of error codes is in Error Reference.
Next steps
For model IDs, input limits and live pricing, see Supported Models. For direct generation endpoints, see Direct Responses and Direct Completions. For how documents are split, see How Chunking Works; the tutorial generates its answer with Guarded Responses.Semantic Search with the Embeddings API
End-to-end tutorial that chunks a corpus, indexes it with this endpoint, ranks chunks by cosine similarity, and generates a cited answer with Guarded Responses.
Building a Knowledge Base
Chunking documents before you embed them.
Embeddings API reference
Interactive request builder.

