/v1/embeddings endpoint converts one or more text strings into dense vector representations (embeddings). You can use these vectors to find semantically similar content, build retrieval-augmented generation (RAG) pipelines, cluster documents, or train classifiers. OpenOpen8 is compatible with the OpenAI Embeddings API format, so any OpenAI-compatible embedding client works without modification.
POST /v1/embeddings
Request body
The embedding model to use. For example,
text-embedding-3-small, text-embedding-3-large, or text-embedding-ada-002. The available models depend on your configured channels.The text to embed. Can be a single string or an array of strings. Each string is embedded independently. Arrays are useful for batch embedding multiple documents in one request.
The format of the returned embedding vectors.
float returns an array of floating-point numbers; base64 returns a base64-encoded binary string. Defaults to float.The number of dimensions for the output embedding vector. Supported only by certain models (e.g.,
text-embedding-3-small and text-embedding-3-large). Truncates the embedding to the specified length.An optional identifier for the end user making the request. Used for monitoring and abuse detection on the provider side.
Response
Always
"list".The model that generated the embeddings.
An array of embedding objects, one per input string.
Token usage for the request.
Examples
Common use cases
- Semantic search — embed your document corpus and a user query, then rank documents by cosine similarity to the query vector.
- Retrieval-augmented generation (RAG) — retrieve the most relevant chunks from a knowledge base before passing them to a language model.
- Clustering — group semantically related documents without labeled training data.
- Classification — use embedding vectors as features for downstream classifiers.