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.
| Method | Path | Summary |
|---|---|---|
| GET | /v1/vector_store/list | List registered vector stores |
| POST | /vector_store/delete | Remove a vector store registration |
| POST | /vector_store/info | Get a registered vector store |
| GET | /vector_store/list | List registered vector stores |
| POST | /vector_store/new | Register an existing vector store |
| POST | /vector_store/update | Update 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | No | |
page_size | query | integer | No |
Example request:
curl -X GET "http://localhost:4000/v1/vector_store/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of registered stores with their secrets removed. | application/json Spanway_ManagedVectorStoreListResponse |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
current_page | integer or null | No | Current Page |
data | array of Spanway_ManagedVectorStore | No | Data |
object | "list" | No | Object |
total_count | integer or null | No | Total Count |
total_pages | integer or null | No | Total 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):
| Field | Type | Required | Description |
|---|---|---|---|
vector_store_id | string | Yes | The 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:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the registration was removed. The store at the provider is untouched. | application/json object |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message |
status | "success" | Yes | Status |
vector_store | object or null | No |
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):
| Field | Type | Required | Description |
|---|---|---|---|
vector_store_id | string | Yes | The 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:
| Status | Description | Body |
|---|---|---|
| 200 | The registered store with its secrets removed. | application/json ResponseSpanway_ManagedVectorStore |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
vector_store | Spanway_ManagedVectorStoresTable | No |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | No | |
page_size | query | integer | No |
Example request:
curl -X GET "http://localhost:4000/vector_store/list" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of registered stores with their secrets removed. | application/json Spanway_ManagedVectorStoreListResponse |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
current_page | integer or null | No | Current Page |
data | array of Spanway_ManagedVectorStore | No | Data |
object | "list" | No | Object |
total_count | integer or null | No | Total Count |
total_pages | integer or null | No | Total 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):
| Field | Type | Required | Description |
|---|---|---|---|
created_at | string or null | No | Created At |
custom_llm_provider | string | No | Custom Llm Provider |
is_config | boolean | No | Is Config |
spanway_credential_name | string or null | No | Spanway Credential Name |
spanway_params | object or null | No | Spanway Params |
team_id | string or null | No | Team Id |
updated_at | string or null | No | Updated At |
user_id | string or null | No | User Id |
vector_store_description | string or null | No | Vector Store Description |
vector_store_id | string | No | Vector Store Id |
vector_store_metadata | object or string or null | No | Vector Store Metadata |
vector_store_name | string or null | No | Vector 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:
| Status | Description | Body |
|---|---|---|
| 200 | The registered store with its secrets removed. | application/json object |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message |
status | "success" | Yes | Status |
vector_store | object or null | No |
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):
| Field | Type | Required | Description |
|---|---|---|---|
custom_llm_provider | string or null | No | A new provider for the store |
spanway_credential_name | string or null | No | A saved credential the store uses, or null to stop using one |
vector_store_description | string or null | No | A new description |
vector_store_id | string | Yes | The registered vector store to change |
vector_store_metadata | object or null | No | New metadata, which replaces the stored metadata |
vector_store_name | string or null | No | A 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:
| Status | Description | Body |
|---|---|---|
| 200 | The updated store with its secrets removed. | application/json object |
| 400 | The 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 |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ErrorDetail |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ErrorDetail |
| 404 | The 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 |
| 422 | The 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 |
| 500 | The 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):
| Field | Type | Required | Description |
|---|---|---|---|
created_at | string or null | No | Created At |
custom_llm_provider | string | No | Custom Llm Provider |
is_config | boolean | No | Is Config |
spanway_credential_name | string or null | No | Spanway Credential Name |
spanway_params | object or null | No | Spanway Params |
team_id | string or null | No | Team Id |
updated_at | string or null | No | Updated At |
user_id | string or null | No | User Id |
vector_store_description | string or null | No | Vector Store Description |
vector_store_id | string | No | Vector Store Id |
vector_store_metadata | object or string or null | No | Vector Store Metadata |
vector_store_name | string or null | No | Vector Store Name |