媒體生成
創建研究任務
運行深度網絡研究並進行信息源綜合分析(異步)。
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>"
}