/embeddings, then store the returned vectors in your database or vector index.
Basic Usage
Batch Inputs
Pass an array of strings to embed multiple texts in one request. Each item must be text, not a token ID array. Two limits apply, and both are enforced before the request reaches a model:
Size your ingest batches against the 2,048 cap and chunk long documents below 8,192 tokens per entry. The request body is also strict, so an unrecognized field returns a
400 rather than being ignored.
Common Workflow
- Split source documents into chunks.
- Generate embeddings for each chunk.
- Store vectors and metadata in a vector database.
- Embed the user’s query.
- Retrieve nearby chunks.
- Send the retrieved context to a chat model.
Model Selection
Use the Embedding Models page to compare current embedding models, dimensions, and pricing.Use the same embedding model for indexing and querying. Mixing models can make similarity scores unreliable because vector spaces are not interchangeable.