Settings API
This page documents the 6 gateway endpoints tagged Settings in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| GET | /get/mcp_semantic_filter_settings | Read the MCP semantic filter settings |
| PATCH | /update/mcp_semantic_filter_settings | Change the MCP semantic filter settings |
| GET | /get/websearch_interception_settings | Read the web search interception settings |
| PATCH | /update/websearch_interception_settings | Change the web search interception settings |
| GET | /get/mcp_tool_search_settings | Read the MCP tool search settings |
| PATCH | /update/mcp_tool_search_settings | Change the MCP tool search settings |
Endpoints
GET /get/mcp_semantic_filter_settings
Read the MCP semantic filter settings
Shows the MCP semantic filter settings. When the filter is on, the gateway sends a model only the MCP tools most related to the request, ranked by an embedding model, instead of every tool, which keeps prompts short when many tools are connected. The answer carries the stored values and a description of every field for the Admin UI. Proxy admins and admin viewers may read it, other keys get 401, and it changes nothing.
Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#semantic-tool-filter)
Example request:
curl -X GET "http://localhost:4000/get/mcp_semantic_filter_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The stored settings with a description of every field | application/json MCPSemanticFilterSettingsResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 500 | The gateway runs without a database | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
values | object | Yes | Values |
field_schema | object | Yes | Field Schema |
PATCH /update/mcp_semantic_filter_settings
Change the MCP semantic filter settings
Turns the MCP semantic filter on or off and sets its embedding model, how many tools it keeps and the lowest similarity a tool needs. The settings are saved to the database, applied on this instance at once and on every other instance within about ten seconds, and written to the audit log. Only proxy admins may call it.
Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#semantic-tool-filter)
Request body (application/json, schema MCPSemanticFilterSettings):
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Enable semantic filtering of MCP tools based on query relevance |
embedding_model | string | No | Embedding model to use for semantic similarity (e.g., 'text-embedding-3-small', 'text-embedding-ada-002') |
top_k | integer | No | Number of most relevant tools to return |
similarity_threshold | number | No | Minimum similarity score for tool inclusion (0.0 to 1.0, where 1.0 = exact match) |
Example request:
curl -X PATCH "http://localhost:4000/update/mcp_semantic_filter_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"embedding_model": "text-embedding-3-small",
"top_k": 20,
"similarity_threshold": 0.3
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Stored, every instance picks it up within about ten seconds | application/json SettingsUpdateResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settings | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | What changed |
status | string | Yes | Always success, failures are reported as HTTP errors |
settings | object | Yes | The settings as stored |
GET /get/websearch_interception_settings
Read the web search interception settings
Shows the web search interception settings. When interception is on, the gateway answers a model's web search
tool calls itself with a configured search tool, for providers that cannot search on their own.
active_on_this_pod says whether the instance that answered applies the setting right now. Proxy admins and
admin viewers may read it, other keys get 401, and it changes nothing.
Example request:
curl -X GET "http://localhost:4000/get/websearch_interception_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The stored settings, their schema and whether this instance applies them | application/json WebSearchInterceptionSettingsResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 500 | The gateway runs without a database | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
values | object | Yes | Values |
field_schema | object | Yes | Field Schema |
active_on_this_pod | boolean | No | Whether the process answering this request has the interception callback registered. Read-only: it reports what is running here, while values.enabled is the cluster-wide setting, and the two disagree while a pod is still |
PATCH /update/websearch_interception_settings
Change the web search interception settings
Turns web search interception on or off and sets the providers it applies to, the search tool it uses and how many follow-up model calls one request may chain. The settings are saved to the database, applied on this instance at once and on every other instance within about ten seconds, and written to the audit log. Only proxy admins may call it.
Request body (application/json, schema WebSearchInterceptionSettings):
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Serve web search tool calls from a configured search tool instead of passing them upstream |
enabled_providers | array of string | No | LLM providers to intercept for (e.g. 'bedrock', 'vertex_ai'). Empty intercepts Bedrock only. |
search_tool_name | string or null | No | Name of the configured search tool to run searches through. Empty uses the first one available. |
max_agentic_loops | integer or null | No | How many follow-up model calls one intercepted request may chain. Empty applies the default of 3. |
Example request:
curl -X PATCH "http://localhost:4000/update/websearch_interception_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"enabled_providers": [
"bedrock"
],
"search_tool_name": "web-search",
"max_agentic_loops": 3
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Stored, every instance picks it up within about ten seconds | application/json SettingsUpdateResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settings | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | What changed |
status | string | Yes | Always success, failures are reported as HTTP errors |
settings | object | Yes | The settings as stored |
GET /get/mcp_tool_search_settings
Read the MCP tool search settings
Shows how the mcp_tool_search virtual tool ranks the MCP tools a caller may use: the embedding model, how
many tools a search returns, the lowest similarity and the core tools that always come first. Proxy admins
and admin viewers may read it, other keys get 401, and it changes nothing.
Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#tool-search)
Example request:
curl -X GET "http://localhost:4000/get/mcp_tool_search_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The stored settings with a description of every field | application/json MCPToolSearchSettingsResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 500 | The gateway runs without a database | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
values | object | Yes | Values |
field_schema | object | Yes | Field Schema |
PATCH /update/mcp_tool_search_settings
Change the MCP tool search settings
Changes how the mcp_tool_search virtual tool ranks tools. Leaving out embedding_model keeps keyword
matching. The settings are saved to the database, picked up by every instance within about ten seconds and
written to the audit log. Only proxy admins may call it.
Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#tool-search)
Request body (application/json, schema MCPToolSearchSettings):
| Field | Type | Required | Description |
|---|---|---|---|
embedding_model | string or null | No | Embedding model from model_list used to rank tools by meaning. Unset keeps keyword matching. |
top_k | integer | No | Most ranked tools a search returns. A smaller top_k in the tool call wins. Core tools do not count. |
similarity_threshold | number | No | Lowest cosine similarity a tool needs to appear in semantic results (0.0 = no cutoff). |
core_tools | array of string | No | Tool names always returned first when the caller can access them, e.g. my_server-get_rates. |
Example request:
curl -X PATCH "http://localhost:4000/update/mcp_tool_search_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"embedding_model": "text-embedding-3-small",
"top_k": 5,
"similarity_threshold": 0.2,
"core_tools": [
"billing-get_invoice"
]
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Stored, every instance picks it up within about ten seconds | application/json SettingsUpdateResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settings | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | What changed |
status | string | Yes | Always success, failures are reported as HTTP errors |
settings | object | Yes | The settings as stored |