API Reference
APIUpdated 2026-10-16 · Audience: developers
Broadcast & Read
| Endpoint | Method | Description |
/api/onair | GET | Current broadcast snapshot: item (sentence) + topic + item.bgm if matched |
/events | GET | SSE stream: onair / battle / switch / batch |
/api/battle | GET | Current tug-of-war meter target ∈ [-1,1] |
/api/tv/config | GET | TV config: brand, effects (incl. bgm_default, bgm.enabled), i18n |
/api/topics | GET | Topic clouds with pro/con angles & seeds |
/api/likes/stats | GET | Likes aggregated by cast / topic / side |
/api/health | GET | Service health: tts, talkbuff, topics, mirrors |
Interaction
| Endpoint | Method | Description |
/api/switch | POST | Switch topic {id:"<topic_id>"} (permission-gated) |
/api/topics/synth | POST | Generate a topic card {raw, switch?} → quality-gated, queues to air |
/api/like | POST | Like / support {source, topic_id, side:pro|con} — server-authoritative to current role |
Recording & BGM
| Endpoint | Method | Description |
/api/clip | POST | Render recorded segments → mp4 ?minutes=5&fmt=mp4 |
/api/clip/status | GET | Recording / render progress + clip list |
/api/bgm | GET | BGM library items + status (incl. enabled master) |
/api/bgm/upload | POST | Upload a music file (raw body + query name/filename) |
/api/bgm/link | POST | Link a track to topics / casts / keywords + volume_mult |
/api/bgm/enabled | POST | Flip the BGM master switch {enabled:bool} |
/api/bgm/delete/<id> | POST | Remove a track |
Auth (planned)
| Endpoint | Method | Description |
/api/auth/providers | GET | Enabled providers (google/discord/github/twitter) per config bools |
/api/auth/login/<p> | GET | 302 → IdP authorization (PKCE) |
/api/auth/callback/<p> | GET | Exchange code → account → httpOnly session cookie |
/api/auth/me | GET | Current session (identity + permission) |
/api/auth/logout | POST | Clear session |
Open Reef API · 议题礁石
SchizoFlip 的争议话题公共资产:任何网站/社区/App 可嵌入实时辩论热度(红绿比例)、投票、引用。
公共开放(CORS *,免 token)。话题 = 可引用资产,划线查询 → 有则引用 / 无则新建。
| Endpoint | Method | Description |
/api/v1/reefs/query?title= | GET | 划线查询:有话题 → 返回引用;无 → 相近话题提示 |
/api/v1/reefs | GET | 礁石列表(热度倒序,可过滤 cluster) |
/api/v1/reefs | POST | 新建话题(幂等 + 即时审核:关键词闸 + LLM 语义,敏感标记) |
/api/v1/reefs/{id}/heat | GET | 动态红绿比例 + 24h 趋势(含 total_votes 采样量) |
/api/v1/reefs/{id}/vote | POST | 投票(防重复,同 uid 一次) |
/api/v1/reefs/{id}/cite | POST | 引用统计(embed/widget/API,10min 去重) |
/api/v1/reefs/{id}/subscribe | POST | 订阅话题(变化通知) |
/api/v1/reefs/subscriptions?uid= | GET | 我的订阅 |
/api/v1/reefs/clusters | GET | 话题聚类(关键词 + LLM + 语义近似) |
/api/v1/reefs/stats | GET | 引用统计看板(曝光量) |
/api/v1/reefs/spec | GET | OpenAPI 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 全网收集 + 用户投稿素材 → 评分 → 多形态生成(脱口秀/立论/辩论/金句)。榜首话题可付费激活(官方不负责引流,自带流量用户回本)。
| Endpoint | Method | Description |
/api/v1/reefs/{id}/materials | POST | 投稿素材(UGC 审核:敏感 → rejected) |
/api/v1/reefs/{id}/materials/collect | POST | Agent 全网收集(关键词过滤 + RSS 抓取) |
/api/v1/reefs/{id}/materials/rescore | POST | 素材评分(相关性/新鲜度/观点强度) |
/api/v1/reefs/{id}/shows/generate | POST | 生成场次(需激活;档位限制形态) |
/api/v1/reefs/{id}/showroom/activate | POST | 付费激活 showroom(basic/plus/brand 档) |
/api/v1/reefs/{id}/showroom/status | GET | 激活状态 + 资格 + 档位 |
/api/reefs/showroom/webhook | POST | 真支付回调(HMAC 验签 → 确认激活) |