curl --request POST \
--url https://api.aisa.one/apis/v1/exa/agent/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"query": "Summarize the main changes in RAG evaluation methods over the past year as a bullet list.",
"outputSchema": {},
"input": {
"data": [
"<unknown>"
],
"exclusion": "<unknown>"
},
"effort": "<string>",
"previousRunId": "<string>",
"dataSources": [
"<unknown>"
]
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/agent/runs"
payload = {
"query": "Summarize the main changes in RAG evaluation methods over the past year as a bullet list.",
"outputSchema": {},
"input": {
"data": ["<unknown>"],
"exclusion": "<unknown>"
},
"effort": "<string>",
"previousRunId": "<string>",
"dataSources": ["<unknown>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'Summarize the main changes in RAG evaluation methods over the past year as a bullet list.',
outputSchema: {},
input: {data: ['<unknown>'], exclusion: '<unknown>'},
effort: '<string>',
previousRunId: '<string>',
dataSources: ['<unknown>']
})
};
fetch('https://api.aisa.one/apis/v1/exa/agent/runs', 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/agent/runs",
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' => 'Summarize the main changes in RAG evaluation methods over the past year as a bullet list.',
'outputSchema' => [
],
'input' => [
'data' => [
'<unknown>'
],
'exclusion' => '<unknown>'
],
'effort' => '<string>',
'previousRunId' => '<string>',
'dataSources' => [
'<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.aisa.one/apis/v1/exa/agent/runs"
payload := strings.NewReader("{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/agent/runs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/agent/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3",
"object": "integration_async_job",
"endpoint": "/apis/v1/exa/agent/runs",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"pricing": {
"currency": "USD",
"authorizedMicrosUSD": 123,
"finalMicrosUSD": 123,
"billingMode": "flat_per_call"
},
"output": "<unknown>",
"outputExpired": true,
"error": {
"code": "<string>",
"message": "<string>"
}
}Exa Agent Runs
把一个研究任务交给后台的 agent。
curl --request POST \
--url https://api.aisa.one/apis/v1/exa/agent/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"query": "Summarize the main changes in RAG evaluation methods over the past year as a bullet list.",
"outputSchema": {},
"input": {
"data": [
"<unknown>"
],
"exclusion": "<unknown>"
},
"effort": "<string>",
"previousRunId": "<string>",
"dataSources": [
"<unknown>"
]
}
'import requests
url = "https://api.aisa.one/apis/v1/exa/agent/runs"
payload = {
"query": "Summarize the main changes in RAG evaluation methods over the past year as a bullet list.",
"outputSchema": {},
"input": {
"data": ["<unknown>"],
"exclusion": "<unknown>"
},
"effort": "<string>",
"previousRunId": "<string>",
"dataSources": ["<unknown>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'Summarize the main changes in RAG evaluation methods over the past year as a bullet list.',
outputSchema: {},
input: {data: ['<unknown>'], exclusion: '<unknown>'},
effort: '<string>',
previousRunId: '<string>',
dataSources: ['<unknown>']
})
};
fetch('https://api.aisa.one/apis/v1/exa/agent/runs', 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/agent/runs",
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' => 'Summarize the main changes in RAG evaluation methods over the past year as a bullet list.',
'outputSchema' => [
],
'input' => [
'data' => [
'<unknown>'
],
'exclusion' => '<unknown>'
],
'effort' => '<string>',
'previousRunId' => '<string>',
'dataSources' => [
'<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.aisa.one/apis/v1/exa/agent/runs"
payload := strings.NewReader("{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/agent/runs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/exa/agent/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Summarize the main changes in RAG evaluation methods over the past year as a bullet list.\",\n \"outputSchema\": {},\n \"input\": {\n \"data\": [\n \"<unknown>\"\n ],\n \"exclusion\": \"<unknown>\"\n },\n \"effort\": \"<string>\",\n \"previousRunId\": \"<string>\",\n \"dataSources\": [\n \"<unknown>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3",
"object": "integration_async_job",
"endpoint": "/apis/v1/exa/agent/runs",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"pricing": {
"currency": "USD",
"authorizedMicrosUSD": 123,
"finalMicrosUSD": 123,
"billingMode": "flat_per_call"
},
"output": "<unknown>",
"outputExpired": true,
"error": {
"code": "<string>",
"message": "<string>"
}
}query 和 Idempotency-Key 必填;effort 在深度与耗时之间取舍,outputSchema 约束产出结构,dataSources 限定检索范围,previousRunId 可以接着上一次继续。异步。提交后返回 HTTP 202 和一个任务信封 —— id、object、endpoint、status、createdAt、completedAt、pricing、output、error,此时 output 还是 null。轮询 get_exa_agent_run 直到终态;届时 output 含 text、structured 和 grounding。一个单句问题实测远不到一分钟就完成。按次固定计费 $0.10 —— pricing.billingMode 是 fixed_request,也就是说和 Firecrawl 的爬取不同,价格不随它找到多少而增长。当交付物本身就是一份报告时用它。想要一口气读完的答案,post_exa_answer 约 2 秒就返回。每个不同的任务换一个新的 Idempotency-Key。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求头
使提交具备幂等性的唯一 key(1 到 191 字符)。使用相同 key 和相同请求指纹重复提交会返回原任务。
191请求体
自然语言研究查询。
"Summarize the main changes in RAG evaluation methods over the past year as a bullet list."
用于校验结构化输出的 JSON Schema。
行处理输入:要处理的行以及排除项。
Show child attributes
Show child attributes
该任务的算力/深度层级。
从此前已完成的任务继续。
授予该 Agent 访问权限的第三方数据源(Exa Connect)。
响应
研究任务已受理。Location 响应头指向该任务资源;请轮询直到终态。
一个异步集成任务。由提交调用(HTTP 202)以及轮询/详情调用返回。请按 id 轮询该任务,直到 status 进入终态(completed、failed 或 cancelled)。
唯一的 AIsa 任务标识符。可用它轮询、列出或取消该任务。
"iaj_01HZY8Q2M4K7N9V3T6W1X0B2C3"
始终为 "integration_async_job"。
"integration_async_job"
该任务所属的提交 endpoint。
"/apis/v1/exa/agent/runs"
面向用户的生命周期状态。queued 和 running 为非终态;completed、failed 和 cancelled 为终态。
queued, running, completed, failed, cancelled 任务被受理的时间。
任务进入终态的时间。任务仍处于排队或运行中时为 null。
Show child attributes
Show child attributes
任务结果载荷。仅在 status 为 completed 后出现。对 Agent Runs 而言是结构化的研究结果。
当结果已超过留存窗口、不再可获取时为 true。
当 status 为 failed 时出现,否则为 null。
Show child attributes
Show child attributes