{"openapi":"3.1.0","info":{"title":"SouWen API","description":"给 Agent 用的免费搜索与抓取 API：search 与 fetch 两个动作","version":"3.0.0a1"},"paths":{"/search":{"post":{"summary":"Search","operationId":"agentSearch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-SouWen-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Souwen-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Agentsearch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fetch":{"post":{"summary":"Fetch","operationId":"agentFetch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-SouWen-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Souwen-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Agentfetch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sources":{"get":{"summary":"Sources","operationId":"agentSources","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-SouWen-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Souwen-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Agentsources"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","description":"探针端点 — 仅确认进程存活，不做依赖检查","operationId":"healthz","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"FetchPayload":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":11,"title":"Url"},"max_chars":{"type":"integer","maximum":200000.0,"minimum":1.0,"title":"Max Chars","default":20000},"start":{"type":"integer","minimum":0.0,"title":"Start","default":0},"provider":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Provider"}},"type":"object","required":["url"],"title":"FetchPayload"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SearchPayload":{"properties":{"query":{"type":"string","maxLength":4096,"minLength":1,"title":"Query"},"domain":{"type":"string","pattern":"^(web|news|paper|patent|book|code|community|wiki|images|videos)$","title":"Domain","default":"web"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":8},"providers":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Providers"}},"type":"object","required":["query"],"title":"SearchPayload"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}