媒体生成
创建研究任务
运行深度网络研究并进行信息源综合分析(异步)。
POST
/
api
/
v1
/
research
创建研究任务
curl --request POST \
--url https://api.example.com/api/v1/research \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"depth": "<string>",
"max_sources": 123
}
'import requests
url = "https://api.example.com/api/v1/research"
payload = {
"prompt": "<string>",
"depth": "<string>",
"max_sources": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', depth: '<string>', max_sources: 123})
};
fetch('https://api.example.com/api/v1/research', 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.example.com/api/v1/research",
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([
'prompt' => '<string>',
'depth' => '<string>',
'max_sources' => 123
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/research"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/research")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/research")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"job_id": "<string>",
"status": "<string>",
"created": "<string>",
"poll_url": "<string>"
}运行多信息源综合分析并附带引用的深度网络研究。这是一个异步端点——它会立即返回一个任务 ID(HTTP 202),研究会在后台进行。
研究是异步执行的。请使用 获取任务状态 轮询任务状态,或在 SDK 中使用
theo.waitForJob()。身份验证
需要 Bearer 令牌。参见 身份验证。请求体
string
必填
研究问题或主题。
string
默认值:"advanced"
研究深度。
"basic" 用于快速摘要,"advanced" 用于全面的多信息源分析。integer
默认值:"10"
可参考的最大信息源数量(1–50)。
请求示例
curl -X POST https://www.hitheo.ai/api/v1/research \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Compare React, Vue, and Svelte for enterprise apps in 2026",
"depth": "advanced",
"max_sources": 10
}'
const job = await theo.research({
prompt: "Compare React, Vue, and Svelte for enterprise apps in 2026",
depth: "advanced",
max_sources: 10,
});
// Poll until complete (check every 3s, timeout after 2min)
const result = await theo.waitForJob(job.job_id, 3000, 120_000);
console.log(result.result); // Full research report with citations
响应(HTTP 202)
string
唯一的研究请求 ID(以
res_ 为前缀)。string
用于轮询状态的任务 ID。
string
创建时始终为
"queued"。string
ISO 8601 时间戳。
string
用于轮询任务状态的相对 URL。
响应示例
{
"id": "res_abc123",
"job_id": "job_xyz789",
"status": "queued",
"created": "2026-04-10T12:00:00Z",
"poll_url": "/api/v1/jobs/job_xyz789"
}
错误
| 状态码 | 错误码 | 说明 |
|---|---|---|
| 400 | missing_prompt | 缺少必填的 prompt 参数 |
| 401 | invalid_api_key | 缺少 API 密钥或密钥无效 |
| 503 | queue_unavailable | 研究队列当前不可用——请稍后重试 |
此页面对您有帮助吗?
创建研究任务
curl --request POST \
--url https://api.example.com/api/v1/research \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"depth": "<string>",
"max_sources": 123
}
'import requests
url = "https://api.example.com/api/v1/research"
payload = {
"prompt": "<string>",
"depth": "<string>",
"max_sources": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', depth: '<string>', max_sources: 123})
};
fetch('https://api.example.com/api/v1/research', 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.example.com/api/v1/research",
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([
'prompt' => '<string>',
'depth' => '<string>',
'max_sources' => 123
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/research"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/research")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/research")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"depth\": \"<string>\",\n \"max_sources\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"job_id": "<string>",
"status": "<string>",
"created": "<string>",
"poll_url": "<string>"
}