OPEN API GATEWAY · v2.6 · HTTPS REST

开放 API 接口文档与调用示例

应用于多模态生成场景,根据用户输入的文本、图像、视频,生成相应的文本、图像、视频。 支持通过个人令牌 xnt_live_* 或跨子域会话调用全模态招商加盟合成接口,注册即赠 2000 点创作点券。

接口基址:https://api.xntou.cn。请将示例中的 xnt_live_你的令牌 替换为 用户中心 获取的个人 API Token。
GET /health
公开 · 服务健康检查
curl -s https://api.xntou.cn/health
GET /v1/health
公开 · API 版本健康检查
curl -s https://api.xntou.cn/v1/health
POST /v1/auth/register
公开 · 注册并赠送 2000 点
curl -s -X POST https://api.xntou.cn/v1/auth/register \
  -H 'Content-Type: application/json' \
  -d '{"username":"kunshan_demo","password":"demo123456","displayName":"昆山演示"}'
POST /v1/auth/login
公开 · 登录并写入会话 Cookie
curl -s -c cookies.txt -X POST https://api.xntou.cn/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"identifier":"kunshan_demo","password":"demo123456"}'
POST /v1/auth/logout
公开 · 清除 xntou_session
curl -s -b cookies.txt -X POST https://api.xntou.cn/v1/auth/logout
GET /v1/auth/me
可选 · 当前登录状态
curl -s -b cookies.txt https://api.xntou.cn/v1/auth/me
POST /v1/auth/profile
登录 · 修改显示名、公司、邮箱
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"displayName":"昆山星网招商部","companyName":"昆山星网数科网络科技有限公司"}' \
  https://api.xntou.cn/v1/auth/profile
POST /v1/auth/password
登录 · 修改密码
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"oldPassword":"demo123456","newPassword":"demo654321"}' \
  https://api.xntou.cn/v1/auth/password
POST /v1/auth/reset-token
登录 · 轮换 xnt_live_ 个人令牌
curl -s -X POST -H 'Authorization: Bearer xnt_live_你的令牌' https://api.xntou.cn/v1/auth/reset-token
GET /v1/credits/balance
登录 · 查询创作点券余额
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' https://api.xntou.cn/v1/credits/balance
GET /v1/credits/ledger
登录 · 点券流水
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' 'https://api.xntou.cn/v1/credits/ledger?limit=20'
GET /v1/credits/pricing
公开 · 各模态点券价格
curl -s https://api.xntou.cn/v1/credits/pricing
POST /v1/studio/text
登录 · 选址报告 / 招商文案
curl -s -X POST https://api.xntou.cn/v1/studio/text \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"评估昆山市中心商圈 40 平米茶饮店,月租 12000 元","tier":"standard"}'
POST /v1/studio/judge
登录 · 项目结构化评分
curl -s -X POST https://api.xntou.cn/v1/studio/judge \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"state":"某茶饮品牌加盟费 8 万,保证金 3 万,承诺 8 个月回本","questions":{"payback":"回本承诺是否可信","supply":"供应链是否可控"}}'
POST /v1/studio/ocr
登录 · 合同与门头识图
curl -s -X POST https://api.xntou.cn/v1/studio/ocr \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"imageDataUrl":"data:image/jpeg;base64,...","instruction":"提取加盟合同费用与区域保护条款"}'
POST /v1/studio/image/generate
登录 · 招商海报 / 空间效果图
curl -s -X POST https://api.xntou.cn/v1/studio/image/generate \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"新式茶饮标准店门头,暖木与深绿,夜景灯箱","aspectRatio":"9:16"}'
POST /v1/studio/image/edit
登录 · 毛坯铺面门头改造
curl -s -X POST https://api.xntou.cn/v1/studio/image/edit \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"imageDataUrl":"data:image/jpeg;base64,...","prompt":"改成该茶饮品牌标准门头,保留两侧商铺"}'
POST /v1/studio/video/generate
登录 · 文生视频或图生视频
curl -s -X POST https://api.xntou.cn/v1/studio/video/generate \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"加盟店开业前三秒门头亮灯,随后展示出杯","mode":"t2v"}'
GET /v1/studio/video/:taskId
登录 · 轮询视频任务
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' https://api.xntou.cn/v1/studio/video/123
POST /v1/studio/video/analyze
登录 · 关键帧拆解,可派生图或视频
curl -s -X POST https://api.xntou.cn/v1/studio/video/analyze \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"frames":["data:image/jpeg;base64,..."],"goal":"改写前三秒钩子","videoMeta":{"duration":15},"generateFollowup":"none"}'
POST /v1/studio/audio/tts
登录 · 招商宣讲配音
curl -s -X POST https://api.xntou.cn/v1/studio/audio/tts \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"input":"欢迎了解昆山商圈的茶饮加盟机会。投资有风险。","voice":"Vivian"}'
POST /v1/studio/audio/music
登录 · 品牌宣传配乐
curl -s -X POST https://api.xntou.cn/v1/studio/audio/music \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"lyrics":"清晨开门,一杯热饮,邻里熟客","instructions":"轻快Acoustic,适合门店循环","duration":30}'
POST /v1/studio/translate
登录 · 出海加盟资料翻译
curl -s -X POST https://api.xntou.cn/v1/studio/translate \
  -H 'Authorization: Bearer xnt_live_你的令牌' \
  -H 'Content-Type: application/json' \
  -d '{"text":"区域保护半径 500 米","sourceLang":"zh","targetLang":"en"}'
POST /v1/studio/pipeline/plan
可选 · Multi-Agent 招商全案流水线规划
curl -s -X POST https://api.xntou.cn/v1/studio/pipeline/plan \
  -H 'Content-Type: application/json' \
  -d '{"nodes":["site","judge","image","audio"]}'
GET /v1/works
登录 · 我的生成作品
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' 'https://api.xntou.cn/v1/works?limit=20'
GET /v1/works/:id
登录 · 作品详情
curl -s -H 'Authorization: Bearer xnt_live_你的令牌' https://api.xntou.cn/v1/works/123
DELETE /v1/works/:id
登录 · 删除自己的作品
curl -s -X DELETE -H 'Authorization: Bearer xnt_live_你的令牌' https://api.xntou.cn/v1/works/123
GET /v1/public/algorithm
公开 · 算法备案与场景元数据
curl -s https://api.xntou.cn/v1/public/algorithm
GET /v1/public/showcase
公开 · 合成案例
curl -s 'https://api.xntou.cn/v1/public/showcase?featured=1&limit=12'
GET /v1/public/cities
公开 · 城市选址攻略
curl -s https://api.xntou.cn/v1/public/cities/kunshan
GET /v1/public/projects
公开 · 加盟项目库
curl -s 'https://api.xntou.cn/v1/public/projects?industrySlug=new-tea'
GET /v1/public/guides
公开 · 招商研究方法
curl -s https://api.xntou.cn/v1/public/guides
POST /v1/compliance/report
可选 · 深度合成内容举报
curl -s -X POST https://api.xntou.cn/v1/compliance/report \
  -H 'Content-Type: application/json' \
  -d '{"reporterContact":"compliance@example.com","reportType":"deepfake","description":"该海报疑似冒用品牌门头"}'