Skip to main content

Vector store management API

This page documents the 6 gateway endpoints tagged vector_store_management in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/v1/vector_store/listList registered vector stores
POST/vector_store/deleteRemove a vector store registration
POST/vector_store/infoGet a registered vector store
GET/vector_store/listList registered vector stores
POST/vector_store/newRegister an existing vector store
POST/vector_store/updateUpdate a registered vector store

Endpoints​

GET /v1/vector_store/list​

List registered vector stores

Lists the vector stores registered on the gateway, one page at a time (page and page_size, 100 per page by default), from the config file and the database together. The database owns the stores it holds, so deleted ones leave memory and updated ones sync to it. Stores declared in the config file are always listed and never overwritten by database rows. Secrets are removed and only stores the caller may use are shown. Proxy admins may always call it. Other keys may call it unless general_settings.disable_vector_stores_for_internal_users is on, in which case only team admins may when allow_vector_stores_for_team_admins is set. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/v1/vector_store/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of registered stores with their secrets removed.application/json Spanway_ManagedVectorStoreListResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
current_pageinteger or nullNoCurrent Page
dataarray of Spanway_ManagedVectorStoreNoData
object"list"NoObject
total_countinteger or nullNoTotal Count
total_pagesinteger or nullNoTotal Pages

POST /vector_store/delete​

Remove a vector store registration

Removes a vector store registration from the database and from memory, so keys can no longer search it through the gateway. The store at the provider is untouched. Stores declared in the config file cannot be removed here. Only proxy admins may call it, or a key whose allowed_routes lists this route. The change is written to the audit log.

Request body (application/json, schema VectorStoreDeleteRequest):

FieldTypeRequiredDescription
vector_store_idstringYesThe registered vector store to remove

Example request:

curl -X POST "http://localhost:4000/vector_store/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vector_store_id": "my-kb-id"
}'

Responses:

StatusDescriptionBody
200Confirmation that the registration was removed. The store at the provider is untouched.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
status"success"YesStatus
vector_storeobject or nullNo

POST /vector_store/info​

Get a registered vector store

Returns one registered vector store with its provider, description, metadata, owning team and provider settings, secrets removed. Answers 403 when the caller may not use that store and 404 when no store has that id. Proxy admins may always call it. Other keys may call it unless general_settings.disable_vector_stores_for_internal_users is on, in which case only team admins may when allow_vector_stores_for_team_admins is set. Nothing is changed.

Request body (application/json, schema VectorStoreInfoRequest):

FieldTypeRequiredDescription
vector_store_idstringYesThe registered vector store to read

Example request:

curl -X POST "http://localhost:4000/vector_store/info" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vector_store_id": "my-kb-id"
}'

Responses:

StatusDescriptionBody
200The registered store with its secrets removed.application/json ResponseSpanway_ManagedVectorStore
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
vector_storeSpanway_ManagedVectorStoresTableNo

GET /vector_store/list​

List registered vector stores

Lists the vector stores registered on the gateway, one page at a time (page and page_size, 100 per page by default), from the config file and the database together. The database owns the stores it holds, so deleted ones leave memory and updated ones sync to it. Stores declared in the config file are always listed and never overwritten by database rows. Secrets are removed and only stores the caller may use are shown. Proxy admins may always call it. Other keys may call it unless general_settings.disable_vector_stores_for_internal_users is on, in which case only team admins may when allow_vector_stores_for_team_admins is set. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/vector_store/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of registered stores with their secrets removed.application/json Spanway_ManagedVectorStoreListResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
current_pageinteger or nullNoCurrent Page
dataarray of Spanway_ManagedVectorStoreNoData
object"list"NoObject
total_countinteger or nullNoTotal Count
total_pagesinteger or nullNoTotal Pages

POST /vector_store/new​

Register an existing vector store

Registers a vector store that already exists at a provider, such as a Bedrock knowledge base or an OpenAI vector store, so keys can search it through the gateway by its vector_store_id. Send the id, the provider, a name and description, optional metadata, and the provider settings in spanway_params or a stored credential name. Secrets are removed from the response. Only proxy admins may call it, or a key whose allowed_routes lists this route. The change is written to the audit log. Answers 400 when the id is already registered.

Request body (application/json, schema Spanway_ManagedVectorStore):

FieldTypeRequiredDescription
created_atstring or nullNoCreated At
custom_llm_providerstringNoCustom Llm Provider
is_configbooleanNoIs Config
spanway_credential_namestring or nullNoSpanway Credential Name
spanway_paramsobject or nullNoSpanway Params
team_idstring or nullNoTeam Id
updated_atstring or nullNoUpdated At
user_idstring or nullNoUser Id
vector_store_descriptionstring or nullNoVector Store Description
vector_store_idstringNoVector Store Id
vector_store_metadataobject or string or nullNoVector Store Metadata
vector_store_namestring or nullNoVector Store Name

Example request:

curl -X POST "http://localhost:4000/vector_store/new" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"custom_llm_provider": "bedrock",
"spanway_params": {
"aws_region_name": "us-east-1"
},
"vector_store_description": "Product documentation knowledge base",
"vector_store_id": "my-kb-id",
"vector_store_metadata": {
"owner": "docs-team"
},
"vector_store_name": "product-docs"
}'

Responses:

StatusDescriptionBody
200The registered store with its secrets removed.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesMessage
status"success"YesStatus
vector_storeobject or nullNo

POST /vector_store/update​

Update a registered vector store

Changes the name, description, metadata or provider of a registered vector store. The change is saved to the database and applied to the in-memory registry right away. Stores declared in the config file cannot be changed here. Only proxy admins may call it, or a key whose allowed_routes lists this route. The change is written to the audit log with the value before and after.

Request body (application/json, schema VectorStoreUpdateRequest):

FieldTypeRequiredDescription
custom_llm_providerstring or nullNoA new provider for the store
spanway_credential_namestring or nullNoA saved credential the store uses, or null to stop using one
vector_store_descriptionstring or nullNoA new description
vector_store_idstringYesThe registered vector store to change
vector_store_metadataobject or nullNoNew metadata, which replaces the stored metadata
vector_store_namestring or nullNoA new name

Example request:

curl -X POST "http://localhost:4000/vector_store/update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vector_store_description": "Product documentation, updated for 2026",
"vector_store_id": "my-kb-id"
}'

Responses:

StatusDescriptionBody
200The updated store with its secrets removed.application/json object
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ErrorDetail
401No valid key was sent, or the key has expired or is blocked.application/json ErrorDetail
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ErrorDetail
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ErrorDetail
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default.application/json ErrorDetail
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
created_atstring or nullNoCreated At
custom_llm_providerstringNoCustom Llm Provider
is_configbooleanNoIs Config
spanway_credential_namestring or nullNoSpanway Credential Name
spanway_paramsobject or nullNoSpanway Params
team_idstring or nullNoTeam Id
updated_atstring or nullNoUpdated At
user_idstring or nullNoUser Id
vector_store_descriptionstring or nullNoVector Store Description
vector_store_idstringNoVector Store Id
vector_store_metadataobject or string or nullNoVector Store Metadata
vector_store_namestring or nullNoVector Store Name