メインコンテンツへスキップ
GET /api/v1/cloud/sessions/{session_id}/threads/{thread_id}/stream 1 つの thread の公開イベントを Server-Sent Events としてストリーミングします。 Session が incremental_streaming_enabled: true で作成された場合、このエンドポイントは、要求した thread に限定された増分 agent イベントも発行します。接続ごとに増分イベントを有効化するリクエストパラメータはありません。

パスパラメータ

パラメータ説明
session_idstringsess_ プレフィックス付きの Session ID
thread_idstringsthr_ プレフィックス付きの Thread ID

ヘッダー

ヘッダー必須説明
AuthorizationはいBearer $QODER_PAT
Acceptいいえtext/event-stream を使用します
Last-Event-IDいいえ指定すると、ストリームは指定したイベント ID の後から再開します。イベント ID が存在しない、アーカイブ済み、非公開の内部イベントを指す、またはこの thread に属していない場合は 400 を返します。

リクエスト例

curl -N -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads/sthr_019f00000000000000000000000002bb/stream" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"

ストリーム形式

id: evt_019f00000000000000000000000003cc
event: agent.message
data: {"id":"evt_019f00000000000000000000000003cc","type":"agent.message","content":[{"type":"text","text":"Thread response"}],"processed_at":"2026-06-15T08:02:00.000Z"}

id: evt_c3d4e5f6a7b8c9d0
event: session.thread_status_idle
data: {"agent_name":"my-agent","id":"evt_c3d4e5f6a7b8c9d0","processed_at":"2026-06-15T08:02:01.000Z","session_thread_id":"sthr_019f00000000000000000000000002bb","stop_reason":{"type":"end_turn"},"type":"session.thread_status_idle"}
サーバーは接続を維持するために、定期的に : heartbeat というコメント行を送信します。

増分イベント

有効化された Session では、thread ストリームは要求した thread_id に対して agent.message_startagent.content_block_startagent.content_block_deltaagent.content_block_stopagent.message_deltaagent.message_stop を含めることができます。text_deltainput_json_delta などの delta の詳細は agent.content_block_delta.delta.type の下にネストされており、トップレベルのイベントタイプとしては公開されません。Session schemas を参照してください。

エラー

HTTPタイプトリガー条件
400invalid_request_errorLast-Event-ID がこの Session/thread 内の有効な公開イベントを特定できない(イベントが存在しない、アーカイブ済み、非公開の内部イベント、またはこの thread に属していない)
401authentication_errorPAT が無効または期限切れ
404not_found_errorSession または thread が存在しない
HTTP 404 Not Found
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session thread 'sthr_fakefakefake_xxxxxxxxxxxxxxxx' was not found."
  },
  "request_id": "b5822072-f264-48da-9d61-6d48ffb07551"
}
完全なエラーエンベロープについては エラー を参照してください。

関連項目

Managed Agents

マルチ Agent 協調におけるスレッドイベントのセマンティクスを理解します。

List Thread Events

スレッドの過去イベントをページ送りで参照します。

List Session Threads

Session 内のすべてのスレッドを表示します。