curl --request POST \
--url https://api.lava.so/v1/search/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"q": "Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks"
}
'import requests
url = "https://api.lava.so/v1/search/answer"
payload = { "q": "Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
q: 'Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks'
})
};
fetch('https://api.lava.so/v1/search/answer', 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://api.lava.so/v1/search/answer",
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([
'q' => 'Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.lava.so/v1/search/answer"
payload := strings.NewReader("{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.lava.so/v1/search/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lava.so/v1/search/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"citations": [
{
"source": "<string>",
"url": "<string>",
"title": "<string>"
}
],
"cost": {
"breakdown": {},
"llm_cost": "<string>",
"markup": "<string>",
"total": "<string>",
"synthesis_error": "<string>"
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}Synthesized answer with citations from the 9-provider fan-out
Same fan-out as /search/sources, plus an LLM synthesis pass that produces a cited answer. Returns { answer, citations, cost } — the underlying sources are not echoed back; call /search/sources separately if you need the raw evidence pile. When the synthesis model fails (timeout, malformed structured output), the endpoint still returns 200 with answer: null and cost.synthesis_error set, but no result list. Charges sum of upstream provider costs + LLM token cost + $0.03 lava-search markup.
curl --request POST \
--url https://api.lava.so/v1/search/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"q": "Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks"
}
'import requests
url = "https://api.lava.so/v1/search/answer"
payload = { "q": "Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
q: 'Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks'
})
};
fetch('https://api.lava.so/v1/search/answer', 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://api.lava.so/v1/search/answer",
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([
'q' => 'Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.lava.so/v1/search/answer"
payload := strings.NewReader("{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.lava.so/v1/search/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lava.so/v1/search/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"q\": \"Current state of NIST post-quantum standardization 2025-2026 — ML-KEM and ML-DSA deployment, FrodoKEM as a hedge, security margin against Module-LWE attacks\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"citations": [
{
"source": "<string>",
"url": "<string>",
"title": "<string>"
}
],
"cost": {
"breakdown": {},
"llm_cost": "<string>",
"markup": "<string>",
"total": "<string>",
"synthesis_error": "<string>"
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}Authorizations
Bearer token authentication used for standard API calls. Format: 'Bearer YOUR_API_KEY'
Body
Response
Synthesized answer with citations. When the LLM step fails, answer is null and cost.synthesis_error is set; the rest of the payload is unchanged. Underlying sources are not echoed back — call /search/sources separately if needed.