Messages

Generate Message Stream

単発メッセージ生成の SSE ストリーミング版 (体感高速化).

/generate と同じ依存 (auth + check_usage_limit でプランキャップを enforce) を持ち、 生成・後処理・課金は完全に同じ経路を通る (use_resonance 判定 → per-shop + global semaphore → wait_for(45) → basic fallback → _finalize_generation). 違いは Writer の token を SSE delta で逐次返すことだけ. 最終的に post-process 済みの message を done イベントで返すので、フロントは delta をプレビュー表示しつつ done で 最終差し替えする (delta は raw writer の途中経過にすぎない).

SSE events (各行 data: <json>\n\n): {"type":"status","stage":"generating"} 生成開始 {"type":"delta","text":"..."} Writer token (プレビュー、途中経過) {"type":"done","result":{...}} 完了. result は /generate と同形の JSON {"type":"error","detail":"..."} 失敗 (classify_api_error の user_message)

課金/メータリングは _finalize_generation を「生成成功時のみ」呼ぶ — エラー時は 増分しない (/generate と同じ). reflective mode は非対応で instant 固定 (mode フィールドは drop). same-day cache 既出力時は即 done で返す.

post/api/messages/generate/stream

Request

  • Base URL: https://api.soeru.biz (the document declares no server; this is the origin it was published from)
  • URL: https://api.soeru.biz/api/messages/generate/stream
  • Auth: none declared. Required headers: authorization

Headers

x-shop-idstring nullable

Optional shop ID

authorizationstring required

Bearer <token>

Request body

order_idstring required
customer_namestring
customer_emailstring nullable
item_namesstring[]
total_priceinteger
is_giftboolean
delivery_contextstring nullable
repeat_countinteger nullable
is_repeatboolean nullable
modestring

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.