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.
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer or null | No | |
after | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/vector_stores/managed" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of the managed vector stores the caller created | application/json object |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Managed 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer or null | No | |
after | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/vector_stores/managed" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of the managed vector stores the caller created | application/json object |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | Managed 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:
| Status | Description | Body |
|---|---|---|
| 200 | Every registered index. | application/json IndexListResponse |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of Spanway_ManagedVectorStoreIndex | Yes | The registered indexes |
object | "list" | No | Always 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):
| Field | Type | Required | Description |
|---|---|---|---|
index_info | object or null | No | Free-form details kept with the index |
index_name | string | Yes | The name keys use for the index, unique on the gateway |
spanway_params | IndexCreateSpanwayParams | Yes | Which 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:
| Status | Description | Body |
|---|---|---|
| 200 | The registered index. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
created_at | string or null | No | When it was registered |
created_by | string or null | No | Who registered it |
id | string | Yes | The id of the index registration |
index_info | object or null | No | Free-form details kept with the index |
index_name | string | Yes | The name keys use for the index |
spanway_params | object | Yes | Which vector store and index it points at |
updated_at | string or null | No | When it was last changed |
updated_by | string or null | No | Who 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
after | query | string or null | No | |
before | query | string or null | No | |
limit | query | integer or null | No | |
order | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/v1/vector_stores" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of vector stores, newest first by default. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object | Yes | Data |
first_id | string or null | Yes | First Id |
has_more | boolean | Yes | Has More |
last_id | string or null | Yes | Last Id |
object | "list" | Yes | Object |
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):
| Field | Type | Required | Description |
|---|---|---|---|
chunking_strategy | object or null | No | Chunking Strategy |
custom_llm_provider | string or null | No | Backend that stores the vectors, such as openai, azure or bedrock |
expires_after | object or null | No | Expires After |
file_ids | array of string or null | No | File Ids |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store object, registered on the gateway. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/v1/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store object, registered on the gateway. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
expires_after | object or null | No | Expires After |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The updated vector store object. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Example request:
curl -X DELETE "http://localhost:4000/v1/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the provider deleted the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
deleted | boolean | Yes | Deleted |
id | string | Yes | Id |
object | "vector_store.deleted" | Yes | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
limit | query | integer | No | How many files to return on one page |
order | query | enum: "asc", "desc" | No | Sort by creation time, oldest or newest first |
after | query | string | No | The last file id of the previous page, to read the next page |
before | query | string | No | The first file id of the next page, to read the previous page |
filter | query | enum: "in_progress", "completed", "failed", "cancelled" | No | Only 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:
| Status | Description | Body |
|---|---|---|
| 200 | One page of the files attached to the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object | No | Data |
first_id | string or null | No | First Id |
has_more | boolean | No | Has More |
last_id | string or null | No | Last Id |
object | "list" | No | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
file_id | string | No | File 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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its indexing status. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its indexing status. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object | No | Attributes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its new attributes. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The file is detached from the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
deleted | boolean | No | Deleted |
id | string | No | Id |
object | "vector_store.file.deleted" | No | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The chunks of the file as the backend indexed them. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
content | array of object | No | Content |
file_id | string | No | File Id |
filename | string or null | No | Filename |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
filters | object or null | No | Filters |
max_num_results | integer or null | No | Max Num Results |
query | string or array of string | No | Query |
ranking_options | object or null | No | Ranking Options |
rewrite_query | boolean or null | No | Rewrite 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:
| Status | Description | Body |
|---|---|---|
| 200 | The matching chunks ordered by score. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object or null | No | Data |
object | "vector_store.search_results.page" | No | Object |
search_query | string or null | No | Search 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
after | query | string or null | No | |
before | query | string or null | No | |
limit | query | integer or null | No | |
order | query | string or null | No |
Example request:
curl -X GET "http://localhost:4000/vector_stores" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | One page of vector stores, newest first by default. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object | Yes | Data |
first_id | string or null | Yes | First Id |
has_more | boolean | Yes | Has More |
last_id | string or null | Yes | Last Id |
object | "list" | Yes | Object |
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):
| Field | Type | Required | Description |
|---|---|---|---|
chunking_strategy | object or null | No | Chunking Strategy |
custom_llm_provider | string or null | No | Backend that stores the vectors, such as openai, azure or bedrock |
expires_after | object or null | No | Expires After |
file_ids | array of string or null | No | File Ids |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store object, registered on the gateway. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store object, registered on the gateway. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
expires_after | object or null | No | Expires After |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The updated vector store object. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
bytes | integer | No | Bytes |
created_at | integer | No | Created At |
expires_after | object or null | No | |
expires_at | integer or null | No | Expires At |
file_counts | object | No | File counts for a vector store |
id | string | No | Id |
last_active_at | integer or null | No | Last Active At |
metadata | object or null | No | Metadata |
name | string or null | No | Name |
object | "vector_store" | No | Object |
status | enum: "expired", "in_progress", "completed" | No | Status |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Example request:
curl -X DELETE "http://localhost:4000/vector_stores/vector_store_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Confirmation that the provider deleted the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
deleted | boolean | Yes | Deleted |
id | string | Yes | Id |
object | "vector_store.deleted" | Yes | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
limit | query | integer | No | How many files to return on one page |
order | query | enum: "asc", "desc" | No | Sort by creation time, oldest or newest first |
after | query | string | No | The last file id of the previous page, to read the next page |
before | query | string | No | The first file id of the next page, to read the previous page |
filter | query | enum: "in_progress", "completed", "failed", "cancelled" | No | Only 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:
| Status | Description | Body |
|---|---|---|
| 200 | One page of the files attached to the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object | No | Data |
first_id | string or null | No | First Id |
has_more | boolean | No | Has More |
last_id | string or null | No | Last Id |
object | "list" | No | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
file_id | string | No | File 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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its indexing status. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its indexing status. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object | No | Attributes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The vector store file with its new attributes. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
chunking_strategy | object or null | No | |
created_at | integer | No | Created At |
id | string | No | Id |
last_error | object or null | No | Last Error |
object | "vector_store.file" | No | Object |
status | enum: "in_progress", "completed", "failed", "cancelled" | No | VectorStoreFileStatus |
usage_bytes | integer or null | No | Usage Bytes |
vector_store_id | string | No | Vector 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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The file is detached from the vector store. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
deleted | boolean | No | Deleted |
id | string | No | Id |
object | "vector_store.file.deleted" | No | Object |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes | |
file_id | path | string | Yes |
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:
| Status | Description | Body |
|---|---|---|
| 200 | The chunks of the file as the backend indexed them. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object or null | No | Attributes |
content | array of object | No | Content |
file_id | string | No | File Id |
filename | string or null | No | Filename |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
vector_store_id | path | string | Yes |
Request body (application/json, object):
| Field | Type | Required | Description |
|---|---|---|---|
filters | object or null | No | Filters |
max_num_results | integer or null | No | Max Num Results |
query | string or array of string | No | Query |
ranking_options | object or null | No | Ranking Options |
rewrite_query | boolean or null | No | Rewrite 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:
| Status | Description | Body |
|---|---|---|
| 200 | The matching chunks ordered by score. | application/json object |
| 400 | The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which. | application/json ProxyError |
| 401 | No valid key was sent, or the key has expired or is blocked. | application/json ProxyError |
| 403 | The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403. | application/json ProxyError |
| 404 | The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...). | application/json ProxyError |
| 408 | The provider did not answer before the request timed out. | application/json ProxyError |
| 413 | The 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. Docs | application/json object |
| 422 | The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. 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 error | application/json ProxyError or HTTPValidationError |
| 429 | Too 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 error | application/json ProxyError |
| 500 | The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing. | application/json ProxyError |
| 502 | The provider, or a proxy in front of it, answered with something that is not a valid response. | application/json ProxyError |
| 503 | The 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. Docs | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object or null | No | Data |
object | "vector_store.search_results.page" | No | Object |
search_query | string or null | No | Search Query |