curl --request POST \
--url https://api.seltz.ai/v1/answer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data @- <<EOF
{
"query": "Who is reported to be Apple's next CEO?"
}
EOFimport requests
url = "https://api.seltz.ai/v1/answer"
payload = { "query": "Who is reported to be Apple's next CEO?" }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Who is reported to be Apple\'s next CEO?'})
};
fetch('https://api.seltz.ai/v1/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.seltz.ai/v1/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([
'query' => 'Who is reported to be Apple\'s next CEO?'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://api.seltz.ai/v1/answer"
payload := strings.NewReader("{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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://api.seltz.ai/v1/answer")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"citations": [
{
"url": "<string>",
"content": "<string>"
}
],
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Answer
curl --request POST \
--url https://api.seltz.ai/v1/answer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data @- <<EOF
{
"query": "Who is reported to be Apple's next CEO?"
}
EOFimport requests
url = "https://api.seltz.ai/v1/answer"
payload = { "query": "Who is reported to be Apple's next CEO?" }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Who is reported to be Apple\'s next CEO?'})
};
fetch('https://api.seltz.ai/v1/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.seltz.ai/v1/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([
'query' => 'Who is reported to be Apple\'s next CEO?'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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://api.seltz.ai/v1/answer"
payload := strings.NewReader("{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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://api.seltz.ai/v1/answer")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seltz.ai/v1/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Who is reported to be Apple's next CEO?\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"citations": [
{
"url": "<string>",
"content": "<string>"
}
],
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Headers
Seltz API key: https://console.seltz.ai/api-keys
Body
JSON request body for POST /v1/answer.
The natural-language question.
API key. Either this or the x-api-key header must be supplied;
the header takes precedence.
When true, citations carry the document content text. Default false.
Selects the answer tier, which determines behavior and billing.
Omitted resolves to the default tier. Independent of scope; the
response shape is unchanged.
Optional OpenAI response_format object ({"type": "text" | "json_object" | "json_schema", ...}), accepted as raw JSON exactly
like /v1/chat/completions. Under a structured type no inline
citations are added, so the answer stays schema-valid; a malformed
value is a 400 before billing. Omitted leaves the answer as Markdown
prose.
Applies at every tier.
Restricts the grounding search to one scope.
Currently available:
web(beta)newswikipediapeoplecompaniesfinancial-reports
Omitted, empty or whitespace-only searches the default scope.
When true, stream the answer as OpenAI-mimic SSE chunks. Default false.
Steers how the answer is presented — tone, voice, format. It is
subordinate to the grounding and citation rules, which stay in force.
That precedence is instructional, not a sandbox. Omitted, empty or
whitespace-only leaves the presentation unchanged. Applies at every
tier and composes with response_format. At most 8 KiB of UTF-8; a
longer value is a 400 before billing.
Response
Answer for the query. When stream = false the body is a JSON AnswerHttpResponse; when stream = true it is a text/event-stream of OpenAI-style chunks.
Buffered JSON response body for POST /v1/answer.
Markdown answer text. Inline citations follow the form
text ([Source Name](url)).
The sources the answer was grounded in. Every source the answer was given is returned, whether or not the text cites it.
Show child attributes
Show child attributes
Identifies this request. Quote it when reporting a problem with the
response. Also returned as the x-request-id response header.