curl -N -X POST https://www.verahealth.ai/api/chat/v3 \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What is the usual adult oral dose of amoxicillin for pneumonia?",
"tools": ["drug"]
}'const response = await fetch("https://www.verahealth.ai/api/chat/v3", {
method: "POST",
headers: {"x-api-key": process.env.VERA_API_KEY, "Content-Type": "application/json"},
body: JSON.stringify({
question: "What is the usual adult oral dose of amoxicillin for pneumonia?",
tools: ["drug"],
stream: false,
}),
});
const {answer, references} = await response.json();
console.log(answer, references.map((reference) => reference.title));import os, requests
response = requests.post(
"https://www.verahealth.ai/api/chat/v3",
headers={"x-api-key": os.environ["VERA_API_KEY"]},
json={
"question": "What is the usual adult oral dose of amoxicillin for pneumonia?",
"tools": ["drug"],
"stream": False,
},
timeout=300,
)
body = response.json()
print(body["answer"])
print([reference["title"] for reference in body["references"]])<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.verahealth.ai/api/chat/v3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question' => 'What is the usual adult oral dose of amoxicillin for pneumonia?',
'thread_id' => '3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b',
'tools' => [
'drug',
'medcalc'
],
'country' => 'FR',
'stream' => true,
'suggestions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.verahealth.ai/api/chat/v3"
payload := strings.NewReader("{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.verahealth.ai/api/chat/v3")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.verahealth.ai/api/chat/v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}"
response = http.request(request)
puts response.read_bodyAsk the agent with a chosen tool set
Preview endpoint: integration testing only. Access is granted under a written testing agreement and is enabled per API key. Request text is sent to the model provider and recorded in Vera’s tracing system, and the endpoint carries no availability or stability commitment. Call it server to server: no CORS headers are sent, so a browser cannot read a cross-origin response, and your API key must never reach a browser.
Runs Vera’s agentic engine and streams the answer along with the tool activity that produced it. The tools parameter selects which optional tools the agent may call, so a single integration can offer a different capability set at each step of a workflow. Omitting it is the same as sending an empty array: there is no per-key default set.
Literature retrieval is always on and is not part of tools, so a caller cannot disable the search every answer depends on. A request without thread_id starts a new thread, saved under your partner account, and its id comes back in the x-thread-id header. Send that id as thread_id to ask a follow-up: Vera answers the new question with the earlier turns of that thread in context, and saves it to the same thread. If a streamed connection drops, reconnect with GET /api/chat/v3/threads//stream, using the same id.
See the tool guide for the tool groups and the agentic streaming guide for the event format, which is not the same as /api/chat/v2.
curl -N -X POST https://www.verahealth.ai/api/chat/v3 \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What is the usual adult oral dose of amoxicillin for pneumonia?",
"tools": ["drug"]
}'const response = await fetch("https://www.verahealth.ai/api/chat/v3", {
method: "POST",
headers: {"x-api-key": process.env.VERA_API_KEY, "Content-Type": "application/json"},
body: JSON.stringify({
question: "What is the usual adult oral dose of amoxicillin for pneumonia?",
tools: ["drug"],
stream: false,
}),
});
const {answer, references} = await response.json();
console.log(answer, references.map((reference) => reference.title));import os, requests
response = requests.post(
"https://www.verahealth.ai/api/chat/v3",
headers={"x-api-key": os.environ["VERA_API_KEY"]},
json={
"question": "What is the usual adult oral dose of amoxicillin for pneumonia?",
"tools": ["drug"],
"stream": False,
},
timeout=300,
)
body = response.json()
print(body["answer"])
print([reference["title"] for reference in body["references"]])<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.verahealth.ai/api/chat/v3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question' => 'What is the usual adult oral dose of amoxicillin for pneumonia?',
'thread_id' => '3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b',
'tools' => [
'drug',
'medcalc'
],
'country' => 'FR',
'stream' => true,
'suggestions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.verahealth.ai/api/chat/v3"
payload := strings.NewReader("{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.verahealth.ai/api/chat/v3")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.verahealth.ai/api/chat/v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"What is the usual adult oral dose of amoxicillin for pneumonia?\",\n \"thread_id\": \"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b\",\n \"tools\": [\n \"drug\",\n \"medcalc\"\n ],\n \"country\": \"FR\",\n \"stream\": true,\n \"suggestions\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API key for authentication. Contact support@verahealth.ai to obtain your API key.
Body
Request envelope for POST /api/chat/v3.
The clinical question to answer.
1"What is the usual adult oral dose of amoxicillin for pneumonia?"
Continue an existing conversation. Pass the x-thread-id (or thread_id) of an earlier answer to ask a follow-up in that thread. Omit it to start a new thread. Only threads created with your partner account can be continued; any other id returns 404.
"3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e9f0a2b"
Optional tools to enable for this request. Omitting the field and sending an empty array are equivalent: both leave every switchable tool off, and the agent answers with the always-on retrieval tools alone. There is no per-key default set. Duplicates are collapsed. An unknown id returns 400; an id your key is not provisioned for returns 403.
A tool you can switch on or off per request. Literature retrieval is always on and is not listed here: it cannot be disabled.
drug, medcalc, patientHandout, priorAuth ["drug", "medcalc"]
Jurisdiction of the clinician, ISO 3166-1 alpha-2. Only the jurisdictions whose national authority publishes in its own language are accepted, because only those change the answer. Case-insensitive. Omit it and no jurisdiction weighting is applied.
FR, IT "FR"
true (default) streams the AI SDK UI message stream. false returns a single JSON payload.
Ask for three follow-up questions derived from the answer. With stream: false they arrive in the suggestions field of the JSON body; a streamed turn emits them as a data-suggestions event. Both lanes send them only when this is true. Off by default because they are a second model call made after the answer is already complete, and a request/response caller waits for it.
Response
When stream is true (default), the response is the AI SDK UI message stream (Content-Type: text/event-stream, x-vercel-ai-ui-message-stream: v1). Each frame is data: {JSON}\n\n with a top-level type, and the stream ends with data: [DONE]. See the agentic streaming guide.
When stream is false, the response is a single JSON payload returned once the answer is complete.
Both responses carry an x-vera-request-id header.
The response is of type string.
Was this page helpful?