Helium Logo
GET/api/v1/public/threads/{thread_id}/response

Get Task Results

Fetches results from a completed or running task. Use this endpoint to poll for task completion and retrieve the generated content.

Request

curl -X GET \
"https://api.he2.ai/api/v1/public/threads/thread_456/response?project_id=proj_123" \
-H "X-API-Key: he-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Path Parameters

ParameterTypeDescription
thread_idstring (required)The thread ID from the create task response

Query Parameters

ParameterTypeDescription
project_idstring (required)Project ID from quick action response
timeoutinteger (optional)Max wait time in seconds (0-600, default: 300)
realtimeboolean (optional)Enable WebSocket-based streaming (default: false)
include_file_contentboolean (optional)Include file content inline (default: false)
pageinteger (optional)Page number for pagination (default: 1)
page_sizeinteger (optional)Items per page (1-1000, default: 100)

Response

{
"success": true,
"thread_id": "thread_456",
"project_id": "proj_123",
"agent_run_id": "run_789",
"status": "completed",
"response": {
"role": "assistant",
"content": "Here is your website...",
"message_id": "msg_1"
},
"has_code": true,
"has_files": true,
"code_blocks": [
{
"language": "html",
"code": "<!DOCTYPE html>..."
}
],
"files": [
{
"file_id": "file_1",
"file_name": "index.html",
"file_size": 2048,
"included_inline": true,
"content": "<!DOCTYPE html>...",
"encoding": "utf-8"
}
]
}

Status Values

  • completed: Task finished successfully
  • running: Task still in progress
  • failed: Task encountered an error
  • stopped: Task was manually stopped
  • no_run: No task exists for this thread

Real-Time Streaming

Get live updates as the AI works using WebSocket-based streaming:

curl -X GET "https://api.he2.ai/api/v1/public/threads/thread_456/response?project_id=proj_123&realtime=true" \
-H "X-API-Key: he-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Stream events:

data: {"type": "status", "status": "running"}
data: {"type": "content", "content": "First chunk..."}
data: {"type": "status", "status": "completed"}