SchizoFlipSchizoFlip/Docs/API Reference

API Reference

APIUpdated 2026-10-16 · Audience: developers

Broadcast & Read

EndpointMethodDescription
/api/onairGETCurrent broadcast snapshot: item (sentence) + topic + item.bgm if matched
/eventsGETSSE stream: onair / battle / switch / batch
/api/battleGETCurrent tug-of-war meter target ∈ [-1,1]
/api/tv/configGETTV config: brand, effects (incl. bgm_default, bgm.enabled), i18n
/api/topicsGETTopic clouds with pro/con angles & seeds
/api/likes/statsGETLikes aggregated by cast / topic / side
/api/healthGETService health: tts, talkbuff, topics, mirrors

Interaction

EndpointMethodDescription
/api/switchPOSTSwitch topic {id:"<topic_id>"} (permission-gated)
/api/topics/synthPOSTGenerate a topic card {raw, switch?} → quality-gated, queues to air
/api/likePOSTLike / support {source, topic_id, side:pro|con} — server-authoritative to current role

Recording & BGM

EndpointMethodDescription
/api/clipPOSTRender recorded segments → mp4 ?minutes=5&fmt=mp4
/api/clip/statusGETRecording / render progress + clip list
/api/bgmGETBGM library items + status (incl. enabled master)
/api/bgm/uploadPOSTUpload a music file (raw body + query name/filename)
/api/bgm/linkPOSTLink a track to topics / casts / keywords + volume_mult
/api/bgm/enabledPOSTFlip the BGM master switch {enabled:bool}
/api/bgm/delete/<id>POSTRemove a track

Auth (planned)

EndpointMethodDescription
/api/auth/providersGETEnabled providers (google/discord/github/twitter) per config bools
/api/auth/login/<p>GET302 → IdP authorization (PKCE)
/api/auth/callback/<p>GETExchange code → account → httpOnly session cookie
/api/auth/meGETCurrent session (identity + permission)
/api/auth/logoutPOSTClear session

Open Reef API · 议题礁石

SchizoFlip 的争议话题公共资产:任何网站/社区/App 可嵌入实时辩论热度(红绿比例)、投票、引用。 公共开放(CORS *,免 token)。话题 = 可引用资产,划线查询 → 有则引用 / 无则新建。

EndpointMethodDescription
/api/v1/reefs/query?title=GET划线查询:有话题 → 返回引用;无 → 相近话题提示
/api/v1/reefsGET礁石列表(热度倒序,可过滤 cluster)
/api/v1/reefsPOST新建话题(幂等 + 即时审核:关键词闸 + LLM 语义,敏感标记)
/api/v1/reefs/{id}/heatGET动态红绿比例 + 24h 趋势(含 total_votes 采样量)
/api/v1/reefs/{id}/votePOST投票(防重复,同 uid 一次)
/api/v1/reefs/{id}/citePOST引用统计(embed/widget/API,10min 去重)
/api/v1/reefs/{id}/subscribePOST订阅话题(变化通知)
/api/v1/reefs/subscriptions?uid=GET我的订阅
/api/v1/reefs/clustersGET话题聚类(关键词 + LLM + 语义近似)
/api/v1/reefs/statsGET引用统计看板(曝光量)
/api/v1/reefs/specGETOpenAPI 3.0 规范(机器可读)

即时审核机制

新建话题时两层审核(秒级):① 关键词闸(瞬时,拦截明确违规词)→ ② LLM 语义审核(2-4s,判断仇恨/色情/暴力/违法/广告等,正常争议辩论话题不误判)。敏感话题标记 review=sensitive(不展示/不播出),规则存 reef_moderation_rules.json 可扩充。

嵌入形态

<debate-reef id="..."> + embed.js(Shadow DOM 隔离,API 地址自动推导)· iframe /reef/{id}/widget(可定制 theme/brand/compact)· 自定义 UI 直调 heat(自动记录曝光引用)。

Showroom · 专有话题直播间

把热门话题深化为可持续产出的深度内容直播间:Agent 全网收集 + 用户投稿素材 → 评分 → 多形态生成(脱口秀/立论/辩论/金句)。榜首话题可付费激活(官方不负责引流,自带流量用户回本)。

EndpointMethodDescription
/api/v1/reefs/{id}/materialsPOST投稿素材(UGC 审核:敏感 → rejected)
/api/v1/reefs/{id}/materials/collectPOSTAgent 全网收集(关键词过滤 + RSS 抓取)
/api/v1/reefs/{id}/materials/rescorePOST素材评分(相关性/新鲜度/观点强度)
/api/v1/reefs/{id}/shows/generatePOST生成场次(需激活;档位限制形态)
/api/v1/reefs/{id}/showroom/activatePOST付费激活 showroom(basic/plus/brand 档)
/api/v1/reefs/{id}/showroom/statusGET激活状态 + 资格 + 档位
/api/reefs/showroom/webhookPOST真支付回调(HMAC 验签 → 确认激活)