{"openapi":"3.1.0","info":{"title":"Surf","description":"Pay-per-use research API for AI agents. Twitter, Reddit, GitHub, and web data with x402 micropayments.","version":"1.0.0","x-guidance":"13 composite endpoints for agent research and inference: /api/v1/twitter/{search,tweet,user}, /api/v1/reddit/{search,post,subreddit,user}, /api/v1/github/{search,get,snapshot}, /api/v1/web/{search,crawl} (GET + POST). OpenAI-compatible inference at /api/v1/inference/v1/chat/completions (POST, streaming supported). Model list at /api/v1/inference/v1/models. All require x402 or MPP payment (USDC on Solana, Base, or Tempo). MCP server at /mcp with tool filtering via ?tools= query param."},"servers":[{"url":"https://surf.cascade.fyi"}],"paths":{"/api/v1/twitter/search":{"post":{"operationId":"postApiV1TwitterSearch","tags":["Twitter"],"summary":"Search tweets","description":"Search Twitter with advanced operators. Returns ~20 tweets per page with engagement summary. Use cursor for pagination.","responses":{"200":{"description":"Search results"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000,"description":"Search query with advanced operators"},"sort":{"default":"Latest","description":"Sort order","type":"string","enum":["Latest","Top"]},"cursor":{"description":"Pagination cursor","type":"string","maxLength":500},"start_date":{"description":"Only tweets on or after this date (YYYY-MM-DD)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"description":"Only tweets before this date (YYYY-MM-DD)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["query"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Search tweets"}}},"/api/v1/twitter/tweet":{"post":{"operationId":"postApiV1TwitterTweet","tags":["Twitter"],"summary":"Fetch tweet","description":"Fetch a tweet with full thread context (all conversation participants), parent tweet, and optionally replies/quotes. Each section returns ~20 items per upstream page with pagination cursors.","responses":{"200":{"description":"Tweet with context"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Not Found"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":2048,"description":"Tweet ID or URL"},"include":{"description":"Optional data to include","type":"array","items":{"type":"string","enum":["replies","quotes"]}}},"required":["ref"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch tweet"}}},"/api/v1/twitter/user":{"post":{"operationId":"postApiV1TwitterUser","tags":["Twitter"],"summary":"Fetch user profile","description":"Fetch a user profile with ~20 recent tweets per page. Use cursor for pagination. Optionally include replies in timeline and mentions.","responses":{"200":{"description":"User with tweets"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Not Found"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":500,"description":"Username or @username"},"include_replies":{"default":false,"description":"Include replies","type":"boolean"},"include_mentions":{"default":false,"description":"Include mentions timeline","type":"boolean"},"cursor":{"description":"Pagination cursor from next_cursor","type":"string","maxLength":500}},"required":["ref"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch user profile"}}},"/api/v1/reddit/search":{"post":{"operationId":"postApiV1RedditSearch","tags":["Reddit"],"summary":"Search Reddit","description":"Search posts across Reddit with sort and time filters.","responses":{"200":{"description":"Search results"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000,"description":"Search query"},"sort":{"default":"relevance","description":"Sort order","type":"string","enum":["relevance","hot","top","new","comments"]},"time":{"default":"all","description":"Time range","type":"string","enum":["hour","day","week","month","year","all"]},"limit":{"default":25,"description":"Max results","type":"integer","minimum":1,"maximum":100},"cursor":{"description":"Pagination cursor","type":"string","maxLength":500},"start_date":{"description":"Only posts on or after this date (YYYY-MM-DD)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"description":"Only posts before this date (YYYY-MM-DD)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["query"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Search Reddit"}}},"/api/v1/reddit/post":{"post":{"operationId":"postApiV1RedditPost","tags":["Reddit"],"summary":"Fetch Reddit post","description":"Fetch a Reddit post with comments, depth/sort control.","responses":{"200":{"description":"Post with comments"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":2048,"description":"Post ID or Reddit URL"},"comment_sort":{"default":"confidence","description":"Comment sort","type":"string","enum":["confidence","top","new","controversial","old","qa"]},"comment_limit":{"default":50,"description":"Max comments","type":"integer","minimum":0,"maximum":200},"comment_depth":{"default":5,"description":"Max nesting depth","type":"integer","minimum":0,"maximum":10}},"required":["ref"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch Reddit post"}}},"/api/v1/reddit/subreddit":{"post":{"operationId":"postApiV1RedditSubreddit","tags":["Reddit"],"summary":"Fetch subreddit","description":"Fetch subreddit info and top posts.","responses":{"200":{"description":"Subreddit with posts"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"description":"Subreddit name"},"sort":{"default":"hot","description":"Post sort","type":"string","enum":["hot","new","top","rising"]},"time":{"default":"day","description":"Time range","type":"string","enum":["hour","day","week","month","year","all"]},"limit":{"default":25,"description":"Max posts","type":"integer","minimum":1,"maximum":100}},"required":["name"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch subreddit"}}},"/api/v1/reddit/user":{"post":{"operationId":"postApiV1RedditUser","tags":["Reddit"],"summary":"Fetch Reddit user","description":"Fetch a Reddit user profile with recent posts and comments.","responses":{"200":{"description":"User with content"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","minLength":1,"maxLength":500,"description":"Reddit username"},"include_posts":{"default":true,"description":"Include recent posts","type":"boolean"},"include_comments":{"default":false,"description":"Include recent comments","type":"boolean"},"max_results":{"default":25,"description":"Max posts/comments","type":"integer","minimum":1,"maximum":100}},"required":["ref"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch Reddit user"}}},"/api/v1/web/search":{"post":{"operationId":"postApiV1WebSearch","tags":["Web"],"summary":"Web search","description":"Search the web using Exa. Returns titles, URLs, and snippets.","responses":{"200":{"description":"Search results"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000,"description":"Search query"},"type":{"default":"auto","description":"Search depth","type":"string","enum":["auto","fast"]},"include_domains":{"description":"Restrict to domains","type":"array","items":{"type":"string"}},"exclude_domains":{"description":"Exclude domains","type":"array","items":{"type":"string"}},"start_published_date":{"description":"Only after ISO date","type":"string"},"end_published_date":{"description":"Only before ISO date","type":"string"},"category":{"description":"Filter by content category","type":"string","enum":["company","research paper","news","pdf","github","tweet","personal site","linkedin profile"]}},"required":["query"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Web search"}}},"/api/v1/web/crawl":{"post":{"operationId":"postApiV1WebCrawl","tags":["Web"],"summary":"Crawl web pages","description":"Extract content from a web page as markdown, HTML, text, or JSON.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"content":{"type":"array","items":{"type":"string"}},"url":{"type":"string"}},"required":["status","content","url"],"description":"CrawlResult"}}},"description":"Crawled content"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Too many concurrent requests"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"description":"URL to crawl"},"format":{"default":"markdown","description":"Output format (json returns structured SSR data when available)","type":"string","enum":["markdown","html","text","json"]},"selector":{"description":"CSS selector","type":"string","maxLength":500},"proxy":{"description":"Use proxy","type":"boolean"},"wait_selector":{"description":"CSS selector to wait for in browser tier (skips HTTP probe)","type":"string","maxLength":500},"force_browser":{"description":"Skip HTTP tier, use browser rendering directly","type":"boolean"},"raw_ssr_data":{"description":"Return raw SSR JSON payload (e.g. __NEXT_DATA__) without processing","type":"boolean"}},"required":["url"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.002","intent":"charge","method":"tempo","amount":"2000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Crawl web pages"}}},"/api/v1/github/search":{"post":{"operationId":"postApiV1GithubSearch","tags":["GitHub"],"summary":"Search GitHub","description":"Search GitHub repositories and conversations (issues + PRs). Supports GitHub search syntax.","responses":{"200":{"description":"Search results"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000,"description":"Search query (supports GitHub search syntax)"},"kind":{"default":"repos","description":"What to search: repos or conversations (issues+PRs)","type":"string","enum":["repos","conversations"]},"page":{"default":1,"description":"Page number","type":"integer","minimum":1,"maximum":10},"per_page":{"default":20,"description":"Results per page","type":"integer","minimum":1,"maximum":30}},"required":["query"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.002","intent":"charge","method":"tempo","amount":"2000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Search GitHub"}}},"/api/v1/github/get":{"post":{"operationId":"postApiV1GithubGet","tags":["GitHub"],"summary":"Fetch GitHub data","description":"Fetch repository data: metadata, readme, files, tree, commits, branches, releases, PRs, or issues.","responses":{"200":{"description":"GitHub data"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Not Found"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","minLength":1,"maxLength":200,"description":"Repository owner"},"repo":{"type":"string","minLength":1,"maxLength":200,"description":"Repository name"},"kind":{"type":"string","enum":["repo","readme","file","tree","commits","branches","releases","pr","issue"],"description":"What to fetch"},"path":{"description":"File path (required for kind=file)","type":"string","maxLength":1000},"ref":{"description":"Branch, tag, or commit SHA","type":"string","maxLength":200},"number":{"description":"PR or issue number (required for kind=pr|issue)","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page":{"default":1,"description":"Page number for paginated results","type":"integer","minimum":1,"maximum":100},"per_page":{"default":30,"description":"Results per page","type":"integer","minimum":1,"maximum":100}},"required":["owner","repo","kind"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.002","intent":"charge","method":"tempo","amount":"2000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch GitHub data"}}},"/api/v1/github/snapshot":{"post":{"operationId":"postApiV1GithubSnapshot","tags":["GitHub"],"summary":"Repository snapshot","description":"Generate or retrieve a downloadable repository snapshot bundle. Returns cached by default (free). Set refresh=true to trigger new build (paid). Pass job_id to poll status.","responses":{"200":{"description":"Snapshot status"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","minLength":1,"maxLength":200,"description":"Repository owner"},"repo":{"type":"string","minLength":1,"maxLength":200,"description":"Repository name"},"ref":{"description":"Branch or tag (default: repo default branch)","type":"string","maxLength":200},"refresh":{"description":"Set true to trigger a new snapshot build (paid)","type":"boolean"},"job_id":{"description":"Job ID to poll build status","type":"string"}},"required":["owner","repo"]}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Repository snapshot"}}},"/api/v1/inference/v1/chat/completions":{"post":{"operationId":"postApiV1InferenceV1ChatCompletions","tags":["Inference"],"summary":"Chat completion","description":"OpenAI-compatible chat completion endpoint. Supports streaming via SSE. Dynamic pricing based on model and token usage.","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"tool_calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]}},"required":["id","type","function"]}}},"required":["role"],"additionalProperties":{}},"finish_reason":{"type":"string"}},"required":["index","message","finish_reason"]}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completion_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["prompt_tokens","completion_tokens","total_tokens"],"additionalProperties":{}}},"required":["id","object","created","model","choices"],"additionalProperties":{},"description":"ChatCompletionResponse"}}},"description":"Chat completion (or SSE stream if stream=true)"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"description":"Model identifier"},"messages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","description":"Message role"},"content":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}}]}},"required":["role"],"additionalProperties":{}},"description":"Chat messages"},"max_tokens":{"description":"Max tokens to generate","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_completion_tokens":{"description":"Max completion tokens (preferred over max_tokens)","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"temperature":{"description":"Sampling temperature (0-2)","anyOf":[{"type":"number"},{"type":"null"}]},"top_p":{"description":"Nucleus sampling","anyOf":[{"type":"number"},{"type":"null"}]},"stream":{"description":"Enable SSE streaming","type":"boolean"},"tools":{"description":"Tool definitions","type":"array","items":{}}},"required":["model","messages"],"additionalProperties":{},"description":"ChatCompletionBody"}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"quote","intent":"charge","method":"tempo","amount":null,"currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Price varies by model and token usage"}}},"/api/v1/inference/v1/messages":{"post":{"operationId":"postApiV1InferenceV1Messages","tags":["Inference"],"summary":"Anthropic Messages API compatible chat","description":"Anthropic Messages API compatible endpoint. Translates to OpenAI format internally, routes through OpenRouter. Supports streaming via SSE.","responses":{"200":{"description":"Anthropic Message (or SSE stream if stream=true)"},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Bad Request"},"402":{"description":"Payment Required"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"}},"required":["error"],"description":"Error"}}},"description":"Upstream Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"description":"Model identifier"},"messages":{"minItems":1,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}}]}},"required":["role","content"],"additionalProperties":{}},"description":"Conversation messages"},"max_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Maximum tokens to generate"},"system":{"description":"System prompt","anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":{}}}]},"stream":{"description":"Enable SSE streaming","type":"boolean"},"temperature":{"description":"Sampling temperature (0-1)","anyOf":[{"type":"number"},{"type":"null"}]},"top_p":{"description":"Nucleus sampling","anyOf":[{"type":"number"},{"type":"null"}]},"top_k":{"description":"Top-K sampling","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tools":{"description":"Tool definitions","type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","properties":{"type":{"type":"string","const":"object"}},"required":["type"],"additionalProperties":{}}},"required":["name","input_schema"],"additionalProperties":{}}},"tool_choice":{"description":"Tool selection mode","anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"auto"}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"any"}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"tool"},"name":{"type":"string"}},"required":["type","name"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":{}}]},"stop_sequences":{"description":"Custom stop sequences","type":"array","items":{"type":"string"}}},"required":["model","messages","max_tokens"],"additionalProperties":{},"description":"AnthropicMessageBody"}}}},"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"quote","intent":"charge","method":"tempo","amount":null,"currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Price varies by model and token usage"}}}},"components":{},"x-service-info":{"categories":["data","search","social"],"docs":{"homepage":"https://surf.cascade.fyi","apiReference":"https://surf.cascade.fyi/openapi.json","llms":"https://surf.cascade.fyi/llms.txt"}},"x-discovery":{"ownershipProofs":["0x6ff121e443566c8168253f88f987d2e64b4cf3ea61fec863b1432de81dec44523d6d6804d31b172ff4cfb8a2e83cf3fe4ab2268d898d8ad728b1e47c8d9c56981c"]}}