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, andindex records each
vector’s position in your input — so you can zip them straight back onto your
records.
OpenAI SDK
Shorter vectors
dimensions truncates the vector, trading a little accuracy for storage and index
size. Both text-embedding-3-* models support it.
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 a400 naming the right
destination:

