Skip to main content
POST
Direct Embeddings

Guide: Embeddings

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

Error Reference

Authentication, billing, invalid model or input, unsupported dimensions, and provider errors.

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. Provider-specific parameters are forwarded except reserved fields. stream and provider are not forwarded; dimension, output_dimension, and output_dimensionality are rejected. user is accepted and ignored.

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 requests an array of numbers; base64 requests little-endian float32 bytes as a base64 string. When omitted, the provider's default applies. Providers may not support every encoding.

Available options:
float,
base64
dimensions
integer

Requested vector width. Support and accepted values depend on the embedding model. Unsupported models or values return 400. The public model catalog reports native dimensions but does not publish shortened-width constraints.

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.