Skip to main content
POST
Direct Embeddings

Guide: Embeddings

Model choice, input limits, pricing, and using the OpenAI SDK against this endpoint.

Error Reference

Common errors: not an embedding model, invalid input, input longer than the model’s limit, provider unavailable.

Authorizations

Authorization
string
header
default:<api-key>
required

Bearer authentication header of the form Bearer <api-key>, where <api-key> is your API key.

Body

application/json

OpenAI-compatible embeddings request. Parameters not listed here are forwarded to the model provider unchanged.

model
string
required

An embedding model's Gloo Model ID (e.g. gloo-openai-text-embedding-3-small). Only models whose output_modalities include embeddings on GET /platform/v2/models are accepted.

Example:

"gloo-openai-text-embedding-3-small"

input
required

The text to embed: a non-empty string, or an array of 1 to 2048 non-empty strings. Each string must fit within the model's max_input_tokens. Arrays of token IDs are not accepted.

Minimum string length: 1
Pattern: \S
Example:
encoding_format
enum<string>

How each vector is encoded. float returns an array of numbers; base64 returns the little-endian float32 bytes as a base64 string. When omitted, the provider's default applies (an array of floats).

Available options:
float,
base64
dimensions
integer

Number of dimensions to return, for models that support shortened embeddings (such as the OpenAI text-embedding-3 models). Omit it for other models.

user
string

Accepted for OpenAI SDK compatibility and ignored.

Response

Embeddings, one per input string, in input order.

object
string
required
Allowed value: "list"
data
Embedding · object[]
required

One embedding per input string, in input order.

model
string
required

The model value exactly as you sent it.

usage
object

Tokens billed for the request. Omitted if the provider reported no usage.