---
title: "使用原始凭证测试 Provider（不落库）"
method: POST
path: "/web-search-providers/test"
tags: ["网络搜索"]
---

# 使用原始凭证测试 Provider（不落库）

`POST /web-search-providers/test`

使用前端表单中尚未保存的凭证测试连通性，用于"测试连接"按钮

## Request body

- InternalHandlerTestProviderRequest
  - `parameters` GithubComTencentWeKnoraInternalTypesWebSearchProviderParameters
    - `api_key` string — API key for the search provider (encrypted in DB)
    - `base_url` string — Base URL for self-hosted search engines (e.g. SearXNG instance URL). Validated with utils.ValidateURLForSSRF; private hosts must be added to SSRF_WHITELIST.
    - `engine_id` string — Google Custom Search Engine ID (only for Google provider)
    - `extra_config` object — Provider-specific extra configuration for future extensibility
    - `proxy_url` string — Optional HTTP/HTTPS proxy URL for outbound search requests (e.g. http://host:port); validated with utils.ValidateURLForSSRF. Does not replace the search API endpoint; only tunnels traffic to the official APIs.
  - `provider` string, required

## Response `200`

测试结果

- object

## Other responses

- `400` — 请求参数错误

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/6e297e21afca/schema)
