Skip to main content

Vector stores API

This page documents the 28 gateway endpoints tagged vector_stores 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/vector_stores/managedList your managed vector stores
GET/v1/vector_stores/managedList your managed vector stores
GET/v1/indexesList registered vector store indexes
POST/v1/indexesRegister a vector store index
GET/v1/vector_storesList vector stores
POST/v1/vector_storesCreate a vector store
GET/v1/vector_stores/{vector_store_id}Get a vector store
POST/v1/vector_stores/{vector_store_id}Modify a vector store
DELETE/v1/vector_stores/{vector_store_id}Delete a vector store
GET/v1/vector_stores/{vector_store_id}/filesList the files in a vector store
POST/v1/vector_stores/{vector_store_id}/filesAttach a file to a vector store
GET/v1/vector_stores/{vector_store_id}/files/{file_id}Get a vector store file
POST/v1/vector_stores/{vector_store_id}/files/{file_id}Update the attributes of a vector store file
DELETE/v1/vector_stores/{vector_store_id}/files/{file_id}Remove a file from a vector store
GET/v1/vector_stores/{vector_store_id}/files/{file_id}/contentRead the indexed content of a vector store file
POST/v1/vector_stores/{vector_store_id}/searchSearch a vector store
GET/vector_storesList vector stores
POST/vector_storesCreate a vector store
GET/vector_stores/{vector_store_id}Get a vector store
POST/vector_stores/{vector_store_id}Modify a vector store
DELETE/vector_stores/{vector_store_id}Delete a vector store
GET/vector_stores/{vector_store_id}/filesList the files in a vector store
POST/vector_stores/{vector_store_id}/filesAttach a file to a vector store
GET/vector_stores/{vector_store_id}/files/{file_id}Get a vector store file
POST/vector_stores/{vector_store_id}/files/{file_id}Update the attributes of a vector store file
DELETE/vector_stores/{vector_store_id}/files/{file_id}Remove a file from a vector store
GET/vector_stores/{vector_store_id}/files/{file_id}/contentRead the indexed content of a vector store file
POST/vector_stores/{vector_store_id}/searchSearch a vector store

Endpoints​

GET /vector_stores/managed​

List your managed vector stores

Lists the managed vector stores the caller created with target_model_names, so a user can find the gateway id of a store that spans several models. Page with limit (1 to 100) and after. Nothing is changed. Answers 500 when the gateway has no database connection.

Parameters:

NameInTypeRequiredDescription
limitqueryinteger or nullNo
afterquerystring or nullNo

Example request:

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

Responses:

StatusDescriptionBody
200One page of the managed vector stores the caller createdapplication/json object
401No valid key or Admin UI session was presentedapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500Managed vector stores are not configured. Ensure the proxy is connected to a database.application/json ErrorDetail

GET /v1/vector_stores/managed​

List your managed vector stores

Lists the managed vector stores the caller created with target_model_names, so a user can find the gateway id of a store that spans several models. Page with limit (1 to 100) and after. Nothing is changed. Answers 500 when the gateway has no database connection.

Parameters:

NameInTypeRequiredDescription
limitqueryinteger or nullNo
afterquerystring or nullNo

Example request:

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

Responses:

StatusDescriptionBody
200One page of the managed vector stores the caller createdapplication/json object
401No valid key or Admin UI session was presentedapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
500Managed vector stores are not configured. Ensure the proxy is connected to a database.application/json ErrorDetail

GET /v1/indexes​

List registered vector store indexes

Lists every vector store index registered on the gateway with the vector store and provider index each one points at. Only proxy admins may call it. Nothing is changed.

Example request:

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

Responses:

StatusDescriptionBody
200Every registered index.application/json IndexListResponse
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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of Spanway_ManagedVectorStoreIndexYesThe registered indexes
object"list"NoAlways list

POST /v1/indexes​

Register a vector store index

Registers a named index that points at an index inside a vector store the gateway already knows, so teams can be given access to one index at a time. Only the registration is written to the database, nothing is created at the provider. Only proxy admins may call it. Answers 400 when an index with that name already exists.

Request body (application/json, schema IndexCreateRequest):

FieldTypeRequiredDescription
index_infoobject or nullNoFree-form details kept with the index
index_namestringYesThe name keys use for the index, unique on the gateway
spanway_paramsIndexCreateSpanwayParamsYesWhich vector store and index it points at

Example request:

curl -X POST "http://localhost:4000/v1/indexes" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"index_name": "product-docs-index",
"spanway_params": {
"vector_store_index": "product-docs",
"vector_store_name": "product-docs-store"
}
}'

Responses:

StatusDescriptionBody
200The registered index.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atstring or nullNoWhen it was registered
created_bystring or nullNoWho registered it
idstringYesThe id of the index registration
index_infoobject or nullNoFree-form details kept with the index
index_namestringYesThe name keys use for the index
spanway_paramsobjectYesWhich vector store and index it points at
updated_atstring or nullNoWhen it was last changed
updated_bystring or nullNoWho last changed it

GET /v1/vector_stores​

List vector stores

Lists the vector stores the provider behind the gateway holds, one page at a time, so you can find the id to search or delete. Use after, before, limit and order to page through them. Any key that may use vector stores may call it, and the request is logged and tracked like any other call. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
afterquerystring or nullNo
beforequerystring or nullNo
limitqueryinteger or nullNo
orderquerystring or nullNo

Example request:

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

Responses:

StatusDescriptionBody
200One page of vector stores, newest first by default.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of objectYesData
first_idstring or nullYesFirst Id
has_morebooleanYesHas More
last_idstring or nullYesLast Id
object"list"YesObject

POST /v1/vector_stores​

Create a vector store

Creates an empty vector store at the provider, ready for files to be attached and searched. Any key that may call the provider can create one. The store is not registered on the gateway, so register it with /vector_store/new before granting it to keys or teams. Send target_model_names, a comma separated list or an array of model names, to create one managed store across several models at once. The change is written to the audit log.

Request body (application/json, object):

FieldTypeRequiredDescription
chunking_strategyobject or nullNoChunking Strategy
custom_llm_providerstring or nullNoBackend that stores the vectors, such as openai, azure or bedrock
expires_afterobject or nullNoExpires After
file_idsarray of string or nullNoFile Ids
metadataobject or nullNoMetadata
namestring or nullNoName

Example request:

curl -X POST "http://localhost:4000/v1/vector_stores" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"custom_llm_provider": "openai",
"metadata": {
"team": "people-ops"
},
"name": "hr-policies"
}'

Responses:

StatusDescriptionBody
200The vector store object, registered on the gateway.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

GET /v1/vector_stores/{vector_store_id}​

Get a vector store

Reads one vector store from the provider, with its name, status, file counts and metadata, so you can check whether its files finished indexing. The key must be allowed to use the store. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The vector store object, registered on the gateway.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

POST /v1/vector_stores/{vector_store_id}​

Modify a vector store

Changes the name, metadata or expiry of a vector store at the provider. The key must be allowed to use the store. The gateway registration is not changed, use /vector_store/update for that. The change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
expires_afterobject or nullNoExpires After
metadataobject or nullNoMetadata
namestring or nullNoName

Example request:

curl -X POST "http://localhost:4000/v1/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"team": "people-ops",
"year": "2026"
},
"name": "hr-policies-2026"
}'

Responses:

StatusDescriptionBody
200The updated vector store object.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

DELETE /v1/vector_stores/{vector_store_id}​

Delete a vector store

Deletes a vector store and its stored chunks at the provider. Files uploaded to it stay in file storage. The key must be allowed to use that vector store, and the request is logged and tracked like any other call. The gateway registration stays until you remove it with /vector_store/delete. The change is written to the audit log and cannot be undone.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/v1/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Confirmation that the provider deleted the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedbooleanYesDeleted
idstringYesId
object"vector_store.deleted"YesObject

GET /v1/vector_stores/{vector_store_id}/files​

List the files in a vector store

List the files attached to the vector store with their indexing status. limit, order, after, before and filter page and filter the list. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
limitqueryintegerNoHow many files to return on one page
orderqueryenum: "asc", "desc"NoSort by creation time, oldest or newest first
afterquerystringNoThe last file id of the previous page, to read the next page
beforequerystringNoThe first file id of the next page, to read the previous page
filterqueryenum: "in_progress", "completed", "failed", "cancelled"NoOnly files with this indexing status

Example request:

curl -X GET "http://localhost:4000/v1/vector_stores/vector_store_id-123/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of the files attached to the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of objectNoData
first_idstring or nullNoFirst Id
has_morebooleanNoHas More
last_idstring or nullNoLast Id
object"list"NoObject

POST /v1/vector_stores/{vector_store_id}/files​

Attach a file to a vector store

Attach a file uploaded with /v1/files to the vector store so the backend chunks, embeds and indexes it, which makes the document searchable for retrieval. attributes become filterable metadata and chunking_strategy controls the chunk size where the backend accepts it. The response reports the indexing status. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
file_idstringNoFile Id

Example request:

curl -X POST "http://localhost:4000/v1/vector_stores/vector_store_id-123/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"department": "people-ops"
},
"chunking_strategy": {
"static": {
"chunk_overlap_tokens": 200,
"max_chunk_size_tokens": 800
},
"type": "static"
},
"file_id": "file-abc123"
}'

Responses:

StatusDescriptionBody
200The vector store file with its indexing status.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

GET /v1/vector_stores/{vector_store_id}/files/{file_id}​

Get a vector store file

Return one vector store file with its status, attributes and last error, for example to check whether indexing finished. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The vector store file with its indexing status.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

POST /v1/vector_stores/{vector_store_id}/files/{file_id}​

Update the attributes of a vector store file

Replace the attributes of a vector store file. Attributes are the metadata that search filters match on. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
attributesobjectNoAttributes

Example request:

curl -X POST "http://localhost:4000/v1/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"department": "people-ops",
"year": "2026"
}
}'

Responses:

StatusDescriptionBody
200The vector store file with its new attributes.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

DELETE /v1/vector_stores/{vector_store_id}/files/{file_id}​

Remove a file from a vector store

Detach the file from the vector store and remove its chunks from the index, so searches stop returning it. The file itself stays in /v1/files. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/v1/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The file is detached from the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedbooleanNoDeleted
idstringNoId
object"vector_store.file.deleted"NoObject

GET /v1/vector_stores/{vector_store_id}/files/{file_id}/content​

Read the indexed content of a vector store file

Return the chunks of the file as the backend stored them, which shows how a document was split. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/v1/vector_stores/vector_store_id-123/files/file_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The chunks of the file as the backend indexed them.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
contentarray of objectNoContent
file_idstringNoFile Id
filenamestring or nullNoFilename

POST /v1/vector_stores/{vector_store_id}/search​

Search a vector store

Finds the chunks in a vector store that best match a question, so an app can show them or pass them to a model. Send the query text, how many results you want and optional metadata filters. The key must be allowed to use the store, and with general_settings.vector_store_deny_by_default on it needs an explicit grant. An id the gateway has not registered is sent to the provider as is. The search is logged and billed like any other call.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
filtersobject or nullNoFilters
max_num_resultsinteger or nullNoMax Num Results
querystring or array of stringNoQuery
ranking_optionsobject or nullNoRanking Options
rewrite_queryboolean or nullNoRewrite Query

Example request:

curl -X POST "http://localhost:4000/v1/vector_stores/vector_store_id-123/search" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filters": {
"key": "department",
"type": "eq",
"value": "people-ops"
},
"max_num_results": 5,
"query": "parental leave policy",
"rewrite_query": false
}'

Responses:

StatusDescriptionBody
200The matching chunks ordered by score.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of object or nullNoData
object"vector_store.search_results.page"NoObject
search_querystring or nullNoSearch Query

GET /vector_stores​

List vector stores

Lists the vector stores the provider behind the gateway holds, one page at a time, so you can find the id to search or delete. Use after, before, limit and order to page through them. Any key that may use vector stores may call it, and the request is logged and tracked like any other call. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
afterquerystring or nullNo
beforequerystring or nullNo
limitqueryinteger or nullNo
orderquerystring or nullNo

Example request:

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

Responses:

StatusDescriptionBody
200One page of vector stores, newest first by default.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of objectYesData
first_idstring or nullYesFirst Id
has_morebooleanYesHas More
last_idstring or nullYesLast Id
object"list"YesObject

POST /vector_stores​

Create a vector store

Creates an empty vector store at the provider, ready for files to be attached and searched. Any key that may call the provider can create one. The store is not registered on the gateway, so register it with /vector_store/new before granting it to keys or teams. Send target_model_names, a comma separated list or an array of model names, to create one managed store across several models at once. The change is written to the audit log.

Request body (application/json, object):

FieldTypeRequiredDescription
chunking_strategyobject or nullNoChunking Strategy
custom_llm_providerstring or nullNoBackend that stores the vectors, such as openai, azure or bedrock
expires_afterobject or nullNoExpires After
file_idsarray of string or nullNoFile Ids
metadataobject or nullNoMetadata
namestring or nullNoName

Example request:

curl -X POST "http://localhost:4000/vector_stores" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"custom_llm_provider": "openai",
"metadata": {
"team": "people-ops"
},
"name": "hr-policies"
}'

Responses:

StatusDescriptionBody
200The vector store object, registered on the gateway.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

GET /vector_stores/{vector_store_id}​

Get a vector store

Reads one vector store from the provider, with its name, status, file counts and metadata, so you can check whether its files finished indexing. The key must be allowed to use the store. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The vector store object, registered on the gateway.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

POST /vector_stores/{vector_store_id}​

Modify a vector store

Changes the name, metadata or expiry of a vector store at the provider. The key must be allowed to use the store. The gateway registration is not changed, use /vector_store/update for that. The change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
expires_afterobject or nullNoExpires After
metadataobject or nullNoMetadata
namestring or nullNoName

Example request:

curl -X POST "http://localhost:4000/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"team": "people-ops",
"year": "2026"
},
"name": "hr-policies-2026"
}'

Responses:

StatusDescriptionBody
200The updated vector store object.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
bytesintegerNoBytes
created_atintegerNoCreated At
expires_afterobject or nullNo
expires_atinteger or nullNoExpires At
file_countsobjectNoFile counts for a vector store
idstringNoId
last_active_atinteger or nullNoLast Active At
metadataobject or nullNoMetadata
namestring or nullNoName
object"vector_store"NoObject
statusenum: "expired", "in_progress", "completed"NoStatus

DELETE /vector_stores/{vector_store_id}​

Delete a vector store

Deletes a vector store and its stored chunks at the provider. Files uploaded to it stay in file storage. The key must be allowed to use that vector store, and the request is logged and tracked like any other call. The gateway registration stays until you remove it with /vector_store/delete. The change is written to the audit log and cannot be undone.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Confirmation that the provider deleted the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedbooleanYesDeleted
idstringYesId
object"vector_store.deleted"YesObject

GET /vector_stores/{vector_store_id}/files​

List the files in a vector store

List the files attached to the vector store with their indexing status. limit, order, after, before and filter page and filter the list. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
limitqueryintegerNoHow many files to return on one page
orderqueryenum: "asc", "desc"NoSort by creation time, oldest or newest first
afterquerystringNoThe last file id of the previous page, to read the next page
beforequerystringNoThe first file id of the next page, to read the previous page
filterqueryenum: "in_progress", "completed", "failed", "cancelled"NoOnly files with this indexing status

Example request:

curl -X GET "http://localhost:4000/vector_stores/vector_store_id-123/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of the files attached to the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of objectNoData
first_idstring or nullNoFirst Id
has_morebooleanNoHas More
last_idstring or nullNoLast Id
object"list"NoObject

POST /vector_stores/{vector_store_id}/files​

Attach a file to a vector store

Attach a file uploaded with /v1/files to the vector store so the backend chunks, embeds and indexes it, which makes the document searchable for retrieval. attributes become filterable metadata and chunking_strategy controls the chunk size where the backend accepts it. The response reports the indexing status. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
file_idstringNoFile Id

Example request:

curl -X POST "http://localhost:4000/vector_stores/vector_store_id-123/files" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"department": "people-ops"
},
"chunking_strategy": {
"static": {
"chunk_overlap_tokens": 200,
"max_chunk_size_tokens": 800
},
"type": "static"
},
"file_id": "file-abc123"
}'

Responses:

StatusDescriptionBody
200The vector store file with its indexing status.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

GET /vector_stores/{vector_store_id}/files/{file_id}​

Get a vector store file

Return one vector store file with its status, attributes and last error, for example to check whether indexing finished. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The vector store file with its indexing status.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

POST /vector_stores/{vector_store_id}/files/{file_id}​

Update the attributes of a vector store file

Replace the attributes of a vector store file. Attributes are the metadata that search filters match on. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
attributesobjectNoAttributes

Example request:

curl -X POST "http://localhost:4000/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"department": "people-ops",
"year": "2026"
}
}'

Responses:

StatusDescriptionBody
200The vector store file with its new attributes.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
chunking_strategyobject or nullNo
created_atintegerNoCreated At
idstringNoId
last_errorobject or nullNoLast Error
object"vector_store.file"NoObject
statusenum: "in_progress", "completed", "failed", "cancelled"NoVectorStoreFileStatus
usage_bytesinteger or nullNoUsage Bytes
vector_store_idstringNoVector Store Id

DELETE /vector_stores/{vector_store_id}/files/{file_id}​

Remove a file from a vector store

Detach the file from the vector store and remove its chunks from the index, so searches stop returning it. The file itself stays in /v1/files. Any key that may use the vector store can call it.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/vector_stores/vector_store_id-123/files/file_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The file is detached from the vector store.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedbooleanNoDeleted
idstringNoId
object"vector_store.file.deleted"NoObject

GET /vector_stores/{vector_store_id}/files/{file_id}/content​

Read the indexed content of a vector store file

Return the chunks of the file as the backend stored them, which shows how a document was split. Any key that may use the vector store can call it, and nothing changes.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes
file_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/vector_stores/vector_store_id-123/files/file_id-123/content" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The chunks of the file as the backend indexed them.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
attributesobject or nullNoAttributes
contentarray of objectNoContent
file_idstringNoFile Id
filenamestring or nullNoFilename

POST /vector_stores/{vector_store_id}/search​

Search a vector store

Finds the chunks in a vector store that best match a question, so an app can show them or pass them to a model. Send the query text, how many results you want and optional metadata filters. The key must be allowed to use the store, and with general_settings.vector_store_deny_by_default on it needs an explicit grant. An id the gateway has not registered is sent to the provider as is. The search is logged and billed like any other call.

Parameters:

NameInTypeRequiredDescription
vector_store_idpathstringYes

Request body (application/json, object):

FieldTypeRequiredDescription
filtersobject or nullNoFilters
max_num_resultsinteger or nullNoMax Num Results
querystring or array of stringNoQuery
ranking_optionsobject or nullNoRanking Options
rewrite_queryboolean or nullNoRewrite Query

Example request:

curl -X POST "http://localhost:4000/vector_stores/vector_store_id-123/search" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filters": {
"key": "department",
"type": "eq",
"value": "people-ops"
},
"max_num_results": 5,
"query": "parental leave policy",
"rewrite_query": false
}'

Responses:

StatusDescriptionBody
200The matching chunks ordered by score.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 ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
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 ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
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. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
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 ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of object or nullNoData
object"vector_store.search_results.page"NoObject
search_querystring or nullNoSearch Query