{"openapi":"3.1.0","info":{"title":"glim","description":"Pay-per-use research API for AI agents. Twitter, Reddit, GitHub, and web data with x402 micropayments.","version":"1.0.0","x-guidance":"glim is a pay-per-use research and inference API. Every /api/v1 endpoint accepts an x402 or MPP wallet payment, or a glim API key / OAuth token (apiKey query param or Authorization: Bearer <key>) charged to your account. The MCP server at /mcp accepts the same credential types."},"servers":[{"url":"https://glim.sh"}],"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":{"description":"Sort order: \"latest\" (newest first) or \"top\" (most engaged). Default: \"latest\".","type":"string","enum":["latest","top"]},"cursor":{"description":"Pagination cursor","type":"string","maxLength":500},"start_date":{"description":"Only tweets on or after this time. YYYY-MM-DD (UTC midnight) or ISO 8601 datetime with Z/offset (e.g. 2026-04-13T14:30:00Z)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2}))?$"},"end_date":{"description":"Only tweets before this time. YYYY-MM-DD (inclusive through end of day UTC) or ISO 8601 datetime with Z/offset (e.g. 2026-04-13T14:30:00Z)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:?\\d{2}))?$"},"expand_urls":{"default":false,"description":"When true, auto-crawl entity URLs and attach crawled_content to tweets. Off by default: responses can grow by up to 4KB per expanded URL. Use surf_web_crawl(url) for targeted crawls instead.","type":"boolean"}},"required":["query"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"]}},"expand_urls":{"default":false,"description":"When true, auto-crawl entity URLs and attach crawled_content to tweets. Off by default: responses can grow by up to 4KB per expanded URL. Use surf_web_crawl(url) for targeted crawls instead.","type":"boolean"}},"required":["ref"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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},"expand_urls":{"default":false,"description":"When true, auto-crawl entity URLs and attach crawled_content to tweets. Off by default: responses can grow by up to 4KB per expanded URL. Use surf_web_crawl(url) for targeted crawls instead.","type":"boolean"}},"required":["ref"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","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"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.015","intent":"charge","method":"tempo","amount":"15000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch Reddit post"}}},"/api/v1/web/search":{"post":{"operationId":"postApiV1WebSearch","tags":["Web"],"summary":"Web search","description":"Semantic web search powered by Exa. Returns titles, URLs, and a query-relevant excerpt per result.","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"},"include_domains":{"description":"Restrict results to these domains (e.g. ['arxiv.org'])","type":"array","items":{"type":"string"}},"exclude_domains":{"description":"Exclude results from these domains. Useful for filtering noisy aggregators or SEO farms when you've seen them dominate results (e.g. ['pinterest.com', 'quora.com']).","type":"array","items":{"type":"string"}},"published_within_days":{"description":"Restrict to results published within the last N days. Skip this for broad queries - it excludes pages without publish-date metadata. Common values: 1, 7, 30, 365.","type":"integer","minimum":1,"maximum":3650}},"required":["query"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"},"outcome":{"type":"string","enum":["success","teaser","thin_content","paywall","bot_challenge","consent_wall","login_wall","rate_limited","timeout","transient_upstream","unsupported_target","not_found","error"],"description":"Classified result type. Use this to branch your retry / strategy logic."},"paywalled":{"description":"True when the URL is paywalled. Equivalent to outcome === 'paywall'.","type":"boolean"},"unsupported_reason":{"description":"When outcome=unsupported_target, why the URL pattern is permanently unsupported.","type":"string"},"alternatives":{"description":"When outcome=unsupported_target, alternative URL patterns or tools that may work.","type":"array","items":{"type":"string"}}},"required":["status","content","url","outcome"],"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. Use 'json' when you want the structured SSR blob (TikTok, Pinterest, etc.) instead of article text.","type":"string","enum":["markdown","html","text","json"]},"selector":{"description":"CSS selector","type":"string","maxLength":500}},"required":["url"],"additionalProperties":false}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"]},"sort":{"description":"Sort field. Repos: stars, forks, updated, help-wanted-issues. Conversations: comments, reactions, interactions, created, updated. Default: best-match (relevance)","default":"best-match","type":"string","enum":["best-match","stars","forks","updated","help-wanted-issues","comments","reactions","interactions","created"]},"order":{"description":"Sort direction (default: desc)","default":"desc","type":"string","enum":["desc","asc"]},"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"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"]}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Repository snapshot"}}},"/api/v1/amazon/search":{"post":{"operationId":"postApiV1AmazonSearch","tags":["Amazon"],"summary":"Search Amazon","description":"Search Amazon by keyword (query) or browse bestsellers by category (category_slug). Regional TLDs: com, co.uk, de, fr, es, it. Returns ranked products with VAT-exclusive net price computed alongside gross.","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"},"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":{"query":{"description":"Free-text keyword query (mutually exclusive with category_slug)","type":"string"},"category_slug":{"description":"Amazon bestsellers category slug, e.g. 'electronics' (.com), 'elektronik' (.de), 'electronique' (.fr). Invalid slugs return 'not_found' - retry with a correct slug.","type":"string"},"tld":{"default":"com","type":"string","enum":["com","co.uk","de","fr","es","it"],"description":"Amazon marketplace: com | co.uk | de | fr | es | it"},"page":{"default":1,"description":"Page number (1-20)","type":"integer","minimum":1,"maximum":20},"response_format":{"default":"concise","description":"'concise' drops images/variants/deep seller metadata; 'detailed' keeps everything","type":"string","enum":["concise","detailed"]},"geo":{"description":"Postal code Amazon uses to compute shipping & delivery dates (e.g. '28001' for Madrid)","type":"string"},"sort_by":{"description":"Server-side sort, except 'most_reviewed' which re-ranks the current page client-side by review count desc (rating tiebreaker). Pair 'most_reviewed' with min_reviews to skip thinly-reviewed items.","type":"string","enum":["most_recent","price_low_to_high","price_high_to_low","featured","average_review","bestsellers","most_reviewed"]},"min_reviews":{"description":"Drop hits with fewer than N reviews. Pair with sort_by='most_reviewed' for a trust-weighted result. Applied client-side to organic/paid/suggested.","type":"integer","minimum":0,"maximum":9007199254740991},"category":{"description":"Amazon node ID to narrow results (returned in `refinements` from a prior call)","type":"string"},"merchant":{"description":"Filter to a specific seller ID","type":"string"},"currency":{"description":"Override display currency. Validated against per-tld allow-list.","type":"string"},"include_paid":{"default":false,"description":"Include sponsored ad results (default: dropped)","type":"boolean"},"include_suggested":{"default":false,"description":"Include 'people also searched for' suggestions (default: dropped)","type":"boolean"}}}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.005","intent":"charge","method":"tempo","amount":"5000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Search Amazon"}}},"/api/v1/amazon/get":{"post":{"operationId":"postApiV1AmazonGet","tags":["Amazon"],"summary":"Fetch Amazon product","description":"Fetch live product detail by 10-char ASIN on a regional marketplace (com, co.uk, de, fr, es, it). Runs 2 upstream calls in parallel (amazon_product + amazon_pricing), returning buybox + full offer listing (including used-condition breakdown) + embedded top reviews.","responses":{"200":{"description":"Product detail"},"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":{"asin":{"type":"string","pattern":"^[A-Z0-9]{10}$","description":"10-char Amazon product ID (e.g. B0F59XT8QM)"},"tld":{"default":"com","type":"string","enum":["com","co.uk","de","fr","es","it"],"description":"Amazon marketplace: com | co.uk | de | fr | es | it"},"response_format":{"default":"concise","description":"'concise' drops images/variants/deep seller metadata; 'detailed' keeps everything","type":"string","enum":["concise","detailed"]},"geo":{"description":"Postal code for region-accurate pricing and delivery dates","type":"string"},"currency":{"description":"Override display currency. Validated against per-tld allow-list.","type":"string"}},"required":["asin"],"description":"Fetch live Amazon product detail by ASIN on a specific TLD. Runs 2 upstream calls (amazon_product + amazon_pricing) in parallel and merges buybox + full offer listing."}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch Amazon product"}}},"/api/v1/amazon/product":{"post":{"operationId":"postApiV1AmazonProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"asin":{"type":"string","pattern":"^[A-Z0-9]{10}$","description":"10-char Amazon product ID (e.g. B0F59XT8QM)"},"tld":{"default":"com","type":"string","enum":["com","co.uk","de","fr","es","it"],"description":"Amazon marketplace: com | co.uk | de | fr | es | it"},"response_format":{"default":"concise","description":"'concise' drops images/variants/deep seller metadata; 'detailed' keeps everything","type":"string","enum":["concise","detailed"]},"geo":{"description":"Postal code for region-accurate pricing and delivery dates","type":"string"},"currency":{"description":"Override display currency. Validated against per-tld allow-list.","type":"string"}},"required":["asin"],"description":"Fetch live Amazon product detail by ASIN on a specific TLD. Runs 2 upstream calls (amazon_product + amazon_pricing) in parallel and merges buybox + full offer listing."}}}},"responses":{"200":{}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"/api/v1/amazon/product"}}},"/api/v1/youtube/get":{"post":{"operationId":"postApiV1YoutubeGet","tags":["YouTube"],"summary":"Fetch YouTube subtitles (VTT file via presigned URL)","description":"Fetch YouTube subtitles/transcript for an 11-char video_id in the requested language and origin (uploader_provided | auto_generated). Returns a presigned download URL to a WebVTT file (transcripts can be 50K+ chars, so file delivery instead of inline text). URL expires in ~1 hour; call again to refresh. Cached 7 days server-side — repeat calls on the same (video_id, language_code, origin) tuple are free after the first.","responses":{"200":{"description":"Subtitles available via presigned download URL"},"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":{"video_id":{"type":"string","pattern":"^[\\w-]{11}$","description":"11-char YouTube video ID (e.g. dQw4w9WgXcQ)"},"language_code":{"default":"en","description":"ISO 639-1 language code (e.g. 'en', 'de', 'fr')","type":"string","minLength":2,"maxLength":10},"origin":{"default":"uploader_provided","description":"'uploader_provided' for human captions (default), 'auto_generated' for YouTube auto-captions.","type":"string","enum":["uploader_provided","auto_generated"]},"format":{"default":"inline","description":"'inline' (default): include vtt in response when transcript fits the inline cap; otherwise omit it and set vtt_omitted_reason. 'url': never include vtt; caller fetches download_url. download_url is always present.","type":"string","enum":["inline","url"]}},"required":["video_id"],"description":"Input for surf_youtube_get / POST /youtube/get"}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"Fetch YouTube subtitles (VTT file via presigned URL)"}}},"/api/v1/youtube/subtitles":{"post":{"operationId":"postApiV1YoutubeSubtitles","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string","pattern":"^[\\w-]{11}$","description":"11-char YouTube video ID (e.g. dQw4w9WgXcQ)"},"language_code":{"default":"en","description":"ISO 639-1 language code (e.g. 'en', 'de', 'fr')","type":"string","minLength":2,"maxLength":10},"origin":{"default":"uploader_provided","description":"'uploader_provided' for human captions (default), 'auto_generated' for YouTube auto-captions.","type":"string","enum":["uploader_provided","auto_generated"]},"format":{"default":"inline","description":"'inline' (default): include vtt in response when transcript fits the inline cap; otherwise omit it and set vtt_omitted_reason. 'url': never include vtt; caller fetches download_url. download_url is always present.","type":"string","enum":["inline","url"]}},"required":["video_id"],"description":"Input for surf_youtube_get / POST /youtube/get"}}}},"responses":{"200":{}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"x-payment-info":{"protocols":["x402","mpp"],"pricingMode":"fixed","price":"0.01","intent":"charge","method":"tempo","amount":"10000","currency":"0x20C000000000000000000000b9537d11c60E8b50","description":"/api/v1/youtube/subtitles"}}},"/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"}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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"}}}},"security":[{},{"ApiKeyQuery":[]},{"ApiKeyBearer":[]}],"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":{"securitySchemes":{"ApiKeyQuery":{"type":"apiKey","in":"query","name":"apiKey","description":"glim API key."},"ApiKeyBearer":{"type":"http","scheme":"bearer","description":"glim API key or OAuth access token."}}},"x-service-info":{"categories":["data","search","social"],"docs":{"homepage":"https://glim.sh","apiReference":"https://glim.sh/openapi.json","llms":"https://glim.sh/llms.txt"}},"x-discovery":{"ownershipProofs":["0x4e01f33f81661fba102be6cd307b50dcbc4d67d757591056487eebe88f2231eb05bf5269c4af447847a4c1bfb9d5ae3490fd7972ef281682209ff6388c0748031b"]}}