Skip to main content
POST /v1/embeddings is drop-in compatible with OpenAI’s Embeddings API. Point an OpenAI client at the gateway, keep your code, and pay from the same credit balance as every other endpoint. Embeddings consume input tokens only — there is no generated output — so they are billed on the input rate alone.

Models

Discover them at runtime instead of hardcoding: GET /v1/models returns output_modality on every entry, and embedding marks the ones this endpoint serves.

Embed one string

Embed a batch

Pass an array. Results come back in request order, and index records each vector’s position in your input — so you can zip them straight back onto your records.
Large batches are split into multiple upstream calls automatically and billed as one request. Each individual string must fit the model’s max input tokens, and a single request is capped at 300,000 tokens across all values.

OpenAI SDK

Shorter vectors

dimensions truncates the vector, trading a little accuracy for storage and index size. Both text-embedding-3-* models support it.
Billing does not change: you pay for input tokens, not for vector width.

Compact transport

encoding_format: "base64" returns each vector as base64-encoded little-endian float32 instead of a JSON number array. Same numbers, far fewer bytes on the wire. The OpenAI SDKs decode it for you; decoding by hand is four lines:

Errors

Embedding models are served only by this endpoint, and this endpoint serves only embedding models. Cross the streams and you get a 400 naming the right destination:
Pre-tokenized input (arrays of integers) is not supported — send strings. See Errors for the full status table.