title: Reconnect to response stream
keywords:

- reconnect to response stream
- get
- reconnect
- response
- stream


# Reconnect to response stream

Reconnect to an active or recently completed response stream. Replays missed events from last_event_id, then live-tails if still streaming. If the stream buffer has expired, synthesizes a completion event from the saved message.

#### Path Parameters

**`thread_id`** string required

The thread id parameter.

#### Query Parameters

**`last_event_id`** integer optional

Resume replay after this event sequence id (the SSE `id:` field, also surfaced as `active_run.last_event_id` on the thread messages endpoint). Omit to replay the full buffered backlog.

## Returns

A Server-Sent Events stream. Every frame buffered **before** you connected — the replay backlog — carries an additional `"source": "replay"` field on its JSON payload, so clients can render the backlog instantly instead of re-animating it. Frames produced after you connect are live and omit `source`. The terminal data event is `response.completed`, followed by the `data: [DONE]` sentinel.

A thread's in-flight run is discoverable without probing this endpoint: `GET /v1/threads/{thread_id}` (and the thread list) report `status: "streaming"` while a run is active, and `GET /v1/threads/{thread_id}/messages` includes an `active_run` object with the `last_event_id` to resume from.

Example

```bash cURL
curl -X GET "https://api.aitronos.com/v1/model/response/{thread_id}/stream" \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.get(
    "https://api.aitronos.com/v1/model/response/{thread_id}/stream",
    headers={"X-API-Key": api_key}
)

print(response.json())
```


```javascript JavaScript
const apiKey = process.env.FREDDY_API_KEY;

const response = await fetch('https://api.aitronos.com/v1/model/response/{thread_id}/stream', {
  method: 'GET',
  headers: {
    'X-API-Key': apiKey
  }
});

const data = await response.json();
console.log(data);
```

**Response:**


```json 200 OK
{
  "success": true
}
```

Errors

```json 401 Unauthorized
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required. Please provide a valid API key.",
    "system_message": "Missing or invalid authorization header",
    "type": "authentication_error",
    "status": 401,
    "details": {},
    "trace_id": "req_abc123xyz",
    "timestamp": "2025-11-11T10:30:00Z"
  }
}
```


```json 403 Forbidden
{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "You do not have permission to access this resource.",
    "system_message": "Insufficient permissions for this operation",
    "type": "authorization_error",
    "status": 403,
    "details": {},
    "trace_id": "req_def456uvw",
    "timestamp": "2025-11-11T10:30:00Z"
  }
}
```

## Related Resources

- [Create a response](/docs/api-reference/responses/create)
- [Cancel a response](/docs/api-reference/responses/cancel)
- [Output modes](/docs/api-reference/responses/output-modes)