Prerequisites
1
Prepare Your Inputs
Decide what code snippets or text you want to embed. You can embed multiple strings in a single request.
2
Call the Embeddings API
Send your inputs to the embeddings endpoint to get vector representations.
3
Parse Embedding Results
The API returns an array of embeddings, one for each input string, and usage info.For more details and options, see the API reference.
4
Store and Search with a Vector Database
Once you have your embeddings, you can store them in a vector database such as Turbopuffer or Pinecone. These databases are designed for efficient similarity search over large collections of vectors.Turbopuffer and other vector databases have similar APIs for inserting vectors.This will return the most relevant code snippets or documents from your database, ranked by similarity to the user query.For more details, see the Turbopuffer docs or Pinecone docs.