Search
Search for embeddings relevant to a query in a list of uploaded files.
POST/embeddings
Request Body
- Name
query
- Required
Required
- Type
- string
- Description
Query for which to get related chunks and embeddings.
- Name
file_ids
- Required
Required
- Type
- array
- Description
Array of file UUIDs to search in. Must contain at least one file ID.
- Name
k
- Type
- integer
- Description
Number of related chunks to return.
Default: 3
Before you can make requests to the Supavec API, you will need to grab your API key from your dashboard.
JavaScript
const res = await fetch("https://api.supavec.com/embeddings", {
method: "POST",
headers: {
"Content-Type": "application/json",
authorization: apiKey,
},
body: JSON.stringify({ query, file_ids: [fileId] }),
});
Response
{
"success": true,
"documents": [
{
"content": "my name is jon.",
"file_id": "939b2cd7-56d5-4c44-b491-14bfc202e9a0",
"score": "0.273"
}
]
}