In-app assistant
POST /assistant/sessions/{id}/messages 工作階段或 API 金鑰
Send a message and stream the turn as Server-Sent Events.
Body is {"text": "..."} (max ~8000 characters, deployment-configured). The response is text/event-stream, not JSON: each frame is event: <kind> plus a data: line carrying the JSON event (whose own type field repeats the kind). Kinds: queued (this turn waited for one already running), user_prompt, assistant_text / assistant_thought (streamed deltas), tool_use / tool_result, usage, and exactly one terminal result carrying stop_reason (completed, cancelled, or error). The turn keeps running even if you stop reading — stopping it is a separate call to .../cancel.
路徑參數
idstring (UUID) 必填- The session id.
請求內容
textstring 必填- Your message.範例
Should I relocate for this role?
curl -N -X POST "https://freehire.me/api/v1/assistant/sessions/<id>/messages" \
-H "Authorization: Bearer $FREEHIRE_API_KEY" -H 'Content-Type: application/json' \
-d '{"text":"Should I relocate for this role?"}'event: user_prompt
data: {"type":"user_prompt","text":"Should I relocate for this role?"}
event: assistant_text
data: {"type":"assistant_text","text":"Based on the salary range..."}
event: result
data: {"type":"result","stop_reason":"completed"}