获得针对某个问题的带引用直接答案。
curl --request POST \
--url https://api.aisa.one/apis/v1/exa/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Which manufacturers had the top three global EV sales in 2025?",
"text": true,
"outputSchema": {}
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/answer"
payload = {
"query": "Which manufacturers had the top three global EV sales in 2025?",
"text": True,
"outputSchema": {}
}
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({
query: 'Which manufacturers had the top three global EV sales in 2025?',
text: true,
outputSchema: {}
})
};
fetch('https://api.aisa.one/apis/v1/exa/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.aisa.one/apis/v1/exa/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' => 'Which manufacturers had the top three global EV sales in 2025?',
'text' => true,
'outputSchema' => [
]
]),
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.aisa.one/apis/v1/exa/answer"
payload := strings.NewReader("{\n \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\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.aisa.one/apis/v1/exa/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/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 \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"answer": "<unknown>",
"citations": [
{
"id": "<string>",
"url": "<string>",
"title": "<string>",
"author": "<string>",
"publishedDate": "<string>",
"text": "<string>"
}
],
"costDollars": "<unknown>"
}搜索 API
Exa Answer
通过检索来源并生成有依据的回应,得到一个带引用的直接答案。
POST
https://api.aisa.one/apis/v1
/
exa
/
answer
获得针对某个问题的带引用直接答案。
curl --request POST \
--url https://api.aisa.one/apis/v1/exa/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "Which manufacturers had the top three global EV sales in 2025?",
"text": true,
"outputSchema": {}
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/answer"
payload = {
"query": "Which manufacturers had the top three global EV sales in 2025?",
"text": True,
"outputSchema": {}
}
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({
query: 'Which manufacturers had the top three global EV sales in 2025?',
text: true,
outputSchema: {}
})
};
fetch('https://api.aisa.one/apis/v1/exa/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.aisa.one/apis/v1/exa/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' => 'Which manufacturers had the top three global EV sales in 2025?',
'text' => true,
'outputSchema' => [
]
]),
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.aisa.one/apis/v1/exa/answer"
payload := strings.NewReader("{\n \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\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.aisa.one/apis/v1/exa/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/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 \"query\": \"Which manufacturers had the top three global EV sales in 2025?\",\n \"text\": true,\n \"outputSchema\": {}\n}"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"answer": "<unknown>",
"citations": [
{
"id": "<string>",
"url": "<string>",
"title": "<string>",
"author": "<string>",
"publishedDate": "<string>",
"text": "<string>"
}
],
"costDollars": "<unknown>"
}提出一个自然语言
query,返回一个基于检索来源的直接 answer,并同时给出支撑它的 citations。用 type 控制收集来源时使用的检索模式,用 text 让每条引用附带完整页面正文。
提供 outputSchema 可以得到结构化的答案对象,而不是纯字符串。每次成功请求固定计费 $0.08;上游 4xx 响应不计费。如果需要原始搜索结果而不是合成答案,请使用 post_exa-search;如需深度多步研究,请使用 post_exa-agent-runs。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
⌘I