Skip to main content
Using a coding agent? Install the together-embeddings skill to let your agent write correct embeddings code automatically. See agent skills for details.
The embeddings API turns an input string into a vector of numbers. You can compare two vectors to measure how closely related the source texts are. Common use cases include search, classification, recommendations, and retrieval-augmented generation (RAG). For long-term retrieval, store embeddings in a vector database and query by similarity. For the full parameter list, see the Create embedding reference. For available embedding models, see the serverless and dedicated model inference catalogs.

Generate an embedding

Call client.embeddings.create with a model and an input string.
The response contains the embedding under data, along with metadata.
JSON

Generate multiple embeddings

Pass an array of strings to input to embed several texts in one call.
response.data contains one object per input, each with the matching index.
JSON

Next steps