{"openapi":"3.1.0","info":{"title":"CrowdGap AI Forecast API","version":"1.1.0","description":"Evidence-linked probability research for AI agents. Research only; no trading, betting, custody, wallet control, payment execution, or final decisions."},"servers":[{"url":"https://crowdgap-pilot.super-myna-7255.chatgpt.site"}],"externalDocs":{"description":"CrowdGap AI integration guide","url":"https://crowdgap-pilot.super-myna-7255.chatgpt.site/integrate"},"tags":[{"name":"Discovery"},{"name":"Checkout"},{"name":"Forecasts"},{"name":"Subscription"}],"paths":{"/api/demo-forecast":{"get":{"operationId":"getDemoForecast","summary":"Fetch a static forecast fixture without authentication","description":"Non-billable integration test. Performs no live research and consumes no quota.","tags":["Discovery"],"security":[],"parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"description":"Anonymous acquisition-channel token."},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"description":"Anonymous campaign token."}],"responses":{"200":{"description":"Static demonstration response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoForecastResponse"}}}}}}},"/api/xrp-checkout/quote":{"post":{"operationId":"createXrpSubscriptionQuote","summary":"Create an idempotent 15-minute XRP quote for US$99","description":"Returns payment instructions for a human operator. It never connects to a wallet, signs, sends, or executes a transaction.","tags":["Checkout"],"security":[],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Must equal requestId."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XrpQuoteRequest"}}}},"responses":{"200":{"description":"Idempotent replay of the same quote","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Quote created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Daily quote limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Safe live XRP price unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/xrp-checkout/verify":{"post":{"operationId":"verifyXrpSubscriptionPayment","summary":"Verify payment and activate the client-held credential","description":"Checks a validated XRPL Payment for the exact amount, address, required Destination Tag, and quote window. The client supplies its private operator UUID and high-entropy subscriber key; CrowdGap stores only the key hash. Exact replay with the same proof confirms the same credential.","tags":["Checkout"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XrpVerificationRequest"}}}},"responses":{"200":{"description":"Payment verified or replayed with the same client-held credential","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Transaction is not validated yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Payment does not match the quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Quote or private operator proof not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Transaction or client-held credential conflicts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Quote expired before payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/forecast-requests":{"post":{"operationId":"createForecast","summary":"Create one evidence-linked probability forecast","tags":["Forecasts"],"security":[{"subscriberBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","format":"uuid"},"description":"Must equal requestId."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastRequest"}}}},"responses":{"200":{"description":"Idempotent replay of a completed forecast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResponse"}}}},"201":{"description":"Forecast completed and recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Forecast allowance reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/subscription":{"get":{"operationId":"getSubscriptionStatus","summary":"Inspect authenticated access, usage, and referral performance","tags":["Subscription"],"security":[{"subscriberBearer":[]}],"responses":{"200":{"description":"Current subscription state and usage","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"subscriberBearer":{"type":"http","scheme":"bearer","bearerFormat":"cg_live_*"}},"schemas":{"XrpQuoteRequest":{"type":"object","additionalProperties":false,"required":["requestId","agentName","operatorReference","referralCode","acquisitionSource","acquisitionCampaign","consent","website"],"properties":{"requestId":{"type":"string","format":"uuid"},"agentName":{"type":"string","minLength":2,"maxLength":120},"operatorReference":{"type":"string","format":"uuid","description":"Private client-generated checkout identity; no email or account is required."},"referralCode":{"type":"string","pattern":"^$|^[a-z0-9]{8,16}$"},"acquisitionSource":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"acquisitionCampaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"consent":{"type":"boolean","const":true},"website":{"type":"string","const":"","description":"Anti-automation honeypot; must be empty."}}},"XrpVerificationRequest":{"type":"object","additionalProperties":false,"required":["quoteId","txHash","operatorReference","subscriberKey"],"properties":{"quoteId":{"type":"string","format":"uuid"},"txHash":{"type":"string","pattern":"^[A-Fa-f0-9]{64}$"},"operatorReference":{"type":"string","format":"uuid"},"subscriberKey":{"type":"string","pattern":"^cg_live_[A-Za-z0-9_-]{32,64}$","description":"Client-generated high-entropy credential. Keep private; CrowdGap stores only its SHA-256 hash."}}},"ForecastRequest":{"type":"object","additionalProperties":false,"required":["requestId","question","deadline","resolutionSource","context","consent"],"properties":{"requestId":{"type":"string","format":"uuid"},"question":{"type":"string","minLength":20,"maxLength":500},"deadline":{"type":"string","format":"date-time","description":"Future deadline, no more than 366 days away."},"resolutionSource":{"type":"string","format":"uri","pattern":"^https://"},"context":{"type":"string","maxLength":2000},"consent":{"type":"boolean","const":true,"description":"Human operator authorized this research request."}}},"Forecast":{"type":"object","additionalProperties":false,"required":["probability","confidence","summary","evidence","assumptions","counterSignals","resolutionCriteria","asOf","limitations"],"properties":{"probability":{"type":"integer","minimum":1,"maximum":99},"confidence":{"type":"string","enum":["low","medium","high"]},"summary":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","required":["title","url","support"],"properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"support":{"type":"string"}}}},"assumptions":{"type":"array","items":{"type":"string"}},"counterSignals":{"type":"array","items":{"type":"string"}},"resolutionCriteria":{"type":"string"},"asOf":{"type":"string"},"limitations":{"type":"string"}}},"ForecastResponse":{"type":"object","required":["ok","forecastId","request","forecast","audit"],"properties":{"ok":{"type":"boolean","const":true},"forecastId":{"type":"string"},"request":{"$ref":"#/components/schemas/ForecastRequest"},"forecast":{"$ref":"#/components/schemas/Forecast"},"usage":{"type":["object","null"]},"audit":{"type":"object"}}},"DemoForecastResponse":{"allOf":[{"$ref":"#/components/schemas/ForecastResponse"},{"type":"object","required":["demo","generated","billable","liveResearch","conversion"],"properties":{"demo":{"type":"boolean","const":true},"generated":{"type":"boolean","const":false},"billable":{"type":"boolean","const":false},"liveResearch":{"type":"boolean","const":false},"conversion":{"type":"object"}}}]},"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}}},"x-crowdgap-commercial":{"audience":"ai_agents","price":{"amount":99,"currency":"USD","accessPeriodDays":30},"includedForecasts":30,"settlement":{"asset":"XRP","network":"XRPL Mainnet","checkoutUrl":"https://crowdgap-pilot.super-myna-7255.chatgpt.site/subscribe","humanAuthorizationRequired":true}},"x-crowdgap-discovery":{"apiCatalog":"https://crowdgap-pilot.super-myna-7255.chatgpt.site/.well-known/api-catalog","apisJson":"https://crowdgap-pilot.super-myna-7255.chatgpt.site/apis.json","mcp":"https://crowdgap-pilot.super-myna-7255.chatgpt.site/api/mcp"}}