Skip to content

Examples

9.1 用户问答示例

Request

curl -X POST "https://api.juai.store/api/v1/ai/chat/send" \
  -H "Content-Type: application/json" \
  -H "X-User-Token: demo-user-token" \
  -d '{"question":"你是谁"}'

Response (截断)

{
  "success": true,
  "code": 0,
  "data": {
    "route": "platform_faq",
    "sub_intent": "ai_product_faq",
    "model_name": "openai/gpt-4o-mini",
    "answer": "我是小JU(Ju AI)..."
  },
  "request_id": "..."
}

9.2 推荐问题示例

curl "https://api.juai.store/api/v1/ai/recommended-questions?scene=market&lang=zh&limit=5" \
  -H "X-User-Token: demo-user-token"

9.3 用户反馈示例

curl -X POST "https://api.juai.store/api/v1/ai/events" \
  -H "Content-Type: application/json" \
  -H "X-User-Token: demo-user-token" \
  -d '{"event_type":"thumbs_up","session_id":1,"message_id":1,"feedback_type":"helpful"}'

9.4 后台问答记录示例(内部)

curl "https://api.juai.store/api/v1/admin/ops/qa-records?page=1&page_size=3&status=all" \
  -H "X-Console-Token: <console-token>"

9.5 积分流水示例

curl "https://api.juai.store/api/v1/ai/points/ledger?page=1&page_size=5" \
  -H "X-User-Token: demo-user-token"

9.6 平台接入示例(草案)

  • 用户登录态透传:exchange_user_id + session_token
  • 调用顺序建议:鉴权 -> 额度查询 -> 问答 -> 记流水