{"openapi":"3.1.0","info":{"title":"Sofya","version":"0.1.0"},"paths":{"/mcp":{"get":{"summary":"Mcp Sse Endpoint","description":"Streamable HTTP GET for server-initiated SSE. Not supported in stateless mode.","operationId":"mcp_sse_endpoint_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Mcp Endpoint","operationId":"mcp_endpoint_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Mcp Delete Endpoint","description":"Session termination. Not applicable in stateless mode.","operationId":"mcp_delete_endpoint_mcp_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/":{"get":{"summary":"Mcp Sse Endpoint","description":"Streamable HTTP GET for server-initiated SSE. Not supported in stateless mode.","operationId":"mcp_sse_endpoint_mcp__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Mcp Endpoint","operationId":"mcp_endpoint_mcp__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Mcp Delete Endpoint","description":"Session termination. Not applicable in stateless mode.","operationId":"mcp_delete_endpoint_mcp__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/search":{"post":{"tags":["search"],"summary":"Search","description":"Search the web and return extracted page content. Supports basic and snippet-only depths, with optional AI answer synthesis.","operationId":"search_v1_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch":{"post":{"tags":["fetch"],"summary":"Fetch","description":"Fetch one or more URLs and return their content as clean markdown. Supports web pages, PDF, DOCX, and other document formats. 1 credit per URL, max 10 URLs.","operationId":"fetch_v1_fetch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/extract":{"post":{"tags":["extract"],"summary":"Extract","description":"Fetch a URL and extract specific information using AI. Returns structured data based on the prompt.","operationId":"extract_v1_extract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/research":{"post":{"tags":["research"],"summary":"Research","description":"Perform comprehensive research on a topic. Decomposes the query, searches multiple sources in parallel, and synthesizes a structured report with citations.","operationId":"research_v1_research_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/status":{"get":{"tags":["status"],"summary":"Public Status","description":"Public endpoint status. No auth required.","operationId":"public_status_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/updates":{"get":{"tags":["updates"],"summary":"Public Updates","description":"Public product changelog. No auth required.","operationId":"public_updates_v1_updates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}}}},"/v1/auth/transactions":{"get":{"tags":["auth"],"summary":"Transactions","operationId":"transactions_v1_auth_transactions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TransactionOut"},"type":"array","title":"Response Transactions V1 Auth Transactions Get"}}}}}}},"/v1/auth/usage":{"get":{"tags":["auth"],"summary":"Usage","operationId":"usage_v1_auth_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"offset_days","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageDayOut"},"title":"Response Usage V1 Auth Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/api-key/regenerate":{"post":{"tags":["auth"],"summary":"Regenerate Api Key","description":"Regenerate the user's API key. Old key stops working immediately.","operationId":"regenerate_api_key_v1_auth_api_key_regenerate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ExtractRequest":{"properties":{"url":{"type":"string","title":"Url","description":"The URL to extract from"},"prompt":{"type":"string","maxLength":4096,"title":"Prompt","description":"What information to extract (e.g. \"list all pricing tiers with features\")"}},"type":"object","required":["url","prompt"],"title":"ExtractRequest"},"ExtractResponse":{"properties":{"content":{"type":"string","title":"Content"},"url":{"type":"string","title":"Url"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"usage":{"additionalProperties":true,"type":"object","title":"Usage"}},"type":"object","required":["content","url","credits_used","credits_remaining","usage"],"title":"ExtractResponse"},"FetchRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Urls","description":"List of URLs to fetch (max 10). Supports web pages, PDF, DOCX, and more."},"include_raw_html":{"type":"boolean","title":"Include Raw Html","description":"Include the raw HTML source for each result","default":false}},"type":"object","required":["urls"],"title":"FetchRequest"},"FetchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/FetchResult"},"type":"array","title":"Results"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_remaining":{"type":"integer","title":"Credits Remaining"}},"type":"object","required":["results","credits_used","credits_remaining"],"title":"FetchResponse"},"FetchResult":{"properties":{"title":{"type":"string","title":"Title","default":""},"url":{"type":"string","title":"Url"},"content":{"type":"string","title":"Content","default":""},"raw_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Html"},"published_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published Time"},"success":{"type":"boolean","title":"Success","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["url"],"title":"FetchResult"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MeResponse":{"properties":{"credits":{"type":"integer","title":"Credits"},"plan_credits":{"type":"integer","title":"Plan Credits"},"purchased_credits":{"type":"integer","title":"Purchased Credits"},"is_free_tier":{"type":"boolean","title":"Is Free Tier","default":false},"credits_reset_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credits Reset At"},"total_requests":{"type":"integer","title":"Total Requests"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"last_login_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login Method"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"github_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Username"}},"type":"object","required":["credits","plan_credits","purchased_credits","total_requests"],"title":"MeResponse"},"ResearchRequest":{"properties":{"query":{"type":"string","maxLength":4096,"title":"Query","description":"The research question or topic"},"topic":{"type":"string","title":"Topic","description":"\"general\" for web search, \"news\" for news articles","default":"general"},"freshness":{"anyOf":[{"type":"string","maxLength":25},{"type":"null"}],"title":"Freshness","description":"Filter by recency: \"day\", \"week\", \"month\", \"year\", or \"YYYY-MM-DD:YYYY-MM-DD\""},"max_sources":{"type":"integer","title":"Max Sources","description":"Maximum number of sources to use (max 30)","default":20}},"type":"object","required":["query"],"title":"ResearchRequest"},"ResearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"report":{"type":"string","title":"Report"},"sources":{"items":{"$ref":"#/components/schemas/ResearchSource"},"type":"array","title":"Sources"},"sub_queries":{"items":{"type":"string"},"type":"array","title":"Sub Queries"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"usage":{"additionalProperties":true,"type":"object","title":"Usage"}},"type":"object","required":["query","report","sources","sub_queries","credits_used","credits_remaining","usage"],"title":"ResearchResponse"},"ResearchSource":{"properties":{"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"fetched":{"type":"boolean","title":"Fetched","default":false}},"type":"object","required":["title","url"],"title":"ResearchSource"},"SearchRequest":{"properties":{"query":{"type":"string","maxLength":2048,"title":"Query","description":"The search query"},"search_depth":{"type":"string","title":"Search Depth","description":"Search depth: \"snippets\" (1 credit) or \"basic\" (3 credits)","default":"basic"},"max_results":{"type":"integer","title":"Max Results","description":"Number of results to return (max 20)","default":10},"include_answer":{"type":"boolean","title":"Include Answer","description":"Generate an AI-synthesized answer from results (adds 5 credits)","default":false},"include_domains":{"items":{"type":"string","maxLength":253,"pattern":"^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}\\.?$"},"type":"array","maxItems":10,"title":"Include Domains","description":"Only include results from these domains (max 10)","default":[]},"exclude_domains":{"items":{"type":"string","maxLength":253,"pattern":"^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}\\.?$"},"type":"array","maxItems":10,"title":"Exclude Domains","description":"Exclude results from these domains (max 10)","default":[]},"topic":{"type":"string","title":"Topic","description":"\"general\" for web search, \"news\" for news articles","default":"general"},"freshness":{"anyOf":[{"type":"string","maxLength":25},{"type":"null"}],"title":"Freshness","description":"Filter by recency: \"day\", \"week\", \"month\", \"year\", or \"YYYY-MM-DD:YYYY-MM-DD\""}},"type":"object","required":["query"],"title":"SearchRequest"},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array","title":"Results"},"search_depth":{"type":"string","title":"Search Depth"},"topic":{"type":"string","title":"Topic"},"elapsed_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Elapsed Ms"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"altered_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Altered Query"}},"type":"object","required":["query","results","search_depth","topic","credits_used","credits_remaining"],"title":"SearchResponse"},"SearchResult":{"properties":{"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"content":{"type":"string","title":"Content","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"fetched":{"type":"boolean","title":"Fetched","default":false},"published_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published Date"},"sublinks":{"items":{"$ref":"#/components/schemas/SearchSublink"},"type":"array","title":"Sublinks","default":[]},"table":{"additionalProperties":true,"type":"object","title":"Table","default":{}}},"type":"object","required":["title","url"],"title":"SearchResult"},"SearchSublink":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"SearchSublink"},"TransactionOut":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"amount":{"type":"integer","title":"Amount"},"endpoint":{"type":"string","title":"Endpoint"},"balance_after":{"type":"integer","title":"Balance After"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","type","amount","endpoint","balance_after","created_at"],"title":"TransactionOut"},"UsageDayOut":{"properties":{"date":{"type":"string","title":"Date"},"endpoint":{"type":"string","title":"Endpoint"},"request_count":{"type":"integer","title":"Request Count"},"total_credits":{"type":"integer","title":"Total Credits"}},"type":"object","required":["date","endpoint","request_count","total_credits"],"title":"UsageDayOut"},"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"}}}}