Create a new vector store
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/vector-stores \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"name": "<string>",
"engine": "sgp_vector_store",
"vector_store_metadata_schema": {},
"embedding_type": "base"
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/vector-stores"
payload = {
"name": "<string>",
"engine": "sgp_vector_store",
"vector_store_metadata_schema": {},
"embedding_type": "base"
}
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
engine: 'sgp_vector_store',
vector_store_metadata_schema: {},
embedding_type: 'base'
})
};
fetch('https://api.example.com/v1/projects/{project_id}/vector-stores', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/projects/{project_id}/vector-stores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'engine' => 'sgp_vector_store',
'vector_store_metadata_schema' => [
],
'embedding_type' => 'base'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/projects/{project_id}/vector-stores"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/projects/{project_id}/vector-stores")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/vector-stores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"engine": "sgp_knowledge_base",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Vector Stores
Create a new vector store
Create a new vector store for a project.
This endpoint creates a vector store using the specified engine and configuration. Currently supports SGP Knowledge Base engine, but we plan to support more engines in the future.
Authentication:
- For SGP Knowledge Base, SGP credentials are required
Returns:
- Created vector store entity with ID, name, engine, and creation timestamp
Example Request:
{
"engine": "sgp_knowledge_base",
"name": "My Knowledge Base",
"embedding_model": "openai/text-embedding-3-large",
}
Example Response:
{
"id": "vs_123456789",
"project_id": "proj_987654321",
"name": "My Knowledge Base",
"engine": "sgp_knowledge_base",
"created_at": "2024-01-15T10:30:00Z"
}
POST
/
v1
/
projects
/
{project_id}
/
vector-stores
Create a new vector store
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/vector-stores \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"name": "<string>",
"engine": "sgp_vector_store",
"vector_store_metadata_schema": {},
"embedding_type": "base"
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/vector-stores"
payload = {
"name": "<string>",
"engine": "sgp_vector_store",
"vector_store_metadata_schema": {},
"embedding_type": "base"
}
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
engine: 'sgp_vector_store',
vector_store_metadata_schema: {},
embedding_type: 'base'
})
};
fetch('https://api.example.com/v1/projects/{project_id}/vector-stores', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/projects/{project_id}/vector-stores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'engine' => 'sgp_vector_store',
'vector_store_metadata_schema' => [
],
'embedding_type' => 'base'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/projects/{project_id}/vector-stores"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/projects/{project_id}/vector-stores")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/vector-stores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"engine\": \"sgp_vector_store\",\n \"vector_store_metadata_schema\": {},\n \"embedding_type\": \"base\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"name": "<string>",
"engine": "sgp_knowledge_base",
"created_at": "2023-11-07T05:31:56Z",
"external_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
- SGPVectorStoreCreateRequestBase
- SGPVectorStoreCreateRequestModelsApi
- SGPKnowledgeBaseCreateRequestBase
- SGPKnowledgeBaseCreateRequestModelsApi
Embedding model to use for SGP Vector Store. e.g. openai/text-embedding-3-large
Available options:
sentence-transformers/all-MiniLM-L12-v2, sentence-transformers/all-mpnet-base-v2, sentence-transformers/multi-qa-distilbert-cos-v1, sentence-transformers/paraphrase-multilingual-mpnet-base-v2, openai/text-embedding-ada-002, openai/text-embedding-3-small, openai/text-embedding-3-large, embed-english-v3.0, embed-english-light-v3.0, embed-multilingual-v3.0, gemini/text-embedding-005, gemini/text-multilingual-embedding-002, gemini/gemini-embedding-001 Response
Vector store created successfully