curl -N https://www.verahealth.ai/api/chat/v3/threads/7d1f0c52-3a9e-4b8e-9f6a-2c4d5e6f7a81/stream \
-H "x-api-key: YOUR_API_KEY"import requests
url = "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body<string>Unauthorized{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}Reconnect to an agentic stream
Picks up an answer started by a streamed POST /api/chat/v3 after the connection dropped. Vera keeps generating when the connection drops, so the answer is still there to collect.
While the answer is being generated, the stream is replayed from its first frame and then continues live, in the same frame format as POST /api/chat/v3. Discard what you had built and parse it from the start.
Once the answer has finished, the response is 204 with no body.
Authorization
Any API key of the partner that started the thread can reconnect, including a rotated one. Keys of any other partner get 404.
curl -N https://www.verahealth.ai/api/chat/v3/threads/7d1f0c52-3a9e-4b8e-9f6a-2c4d5e6f7a81/stream \
-H "x-api-key: YOUR_API_KEY"import requests
url = "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.verahealth.ai/api/chat/v3/threads/{threadId}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body<string>Unauthorized{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}Authorizations
API key for authentication. Contact support@verahealth.ai to obtain your API key.
Path Parameters
The x-thread-id header of the original POST /api/chat/v3 response.
Response
The answer is still being generated: the stream is replayed from its first frame, then continues live.
The response is of type string.
Was this page helpful?