Chat Completion
curl --request POST \
--url https://api.reportify.cn/v1/chat/completion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"folder_ids": [],
"doc_ids": [],
"categories": [],
"markets": [],
"institutions": [],
"symbols": [],
"tags": {},
"start_date": "<string>",
"end_date": "<string>",
"min_score": 123,
"extended_filters": [
{}
],
"mode": "concise",
"session_id": "",
"stream": true
}
'import requests
url = "https://api.reportify.cn/v1/chat/completion"
payload = {
"query": "<string>",
"folder_ids": [],
"doc_ids": [],
"categories": [],
"markets": [],
"institutions": [],
"symbols": [],
"tags": {},
"start_date": "<string>",
"end_date": "<string>",
"min_score": 123,
"extended_filters": [{}],
"mode": "concise",
"session_id": "",
"stream": True
}
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: '<string>',
folder_ids: [],
doc_ids: [],
categories: [],
markets: [],
institutions: [],
symbols: [],
tags: {},
start_date: '<string>',
end_date: '<string>',
min_score: 123,
extended_filters: [{}],
mode: 'concise',
session_id: '',
stream: true
})
};
fetch('https://api.reportify.cn/v1/chat/completion', 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.reportify.cn/v1/chat/completion",
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' => '<string>',
'folder_ids' => [
],
'doc_ids' => [
],
'categories' => [
],
'markets' => [
],
'institutions' => [
],
'symbols' => [
],
'tags' => [
],
'start_date' => '<string>',
'end_date' => '<string>',
'min_score' => 123,
'extended_filters' => [
[
]
],
'mode' => 'concise',
'session_id' => '',
'stream' => true
]),
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.reportify.cn/v1/chat/completion"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\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.reportify.cn/v1/chat/completion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/chat/completion")
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\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"message_id": "<string>",
"message": "<string>",
"extra": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}v1
Completion
Provides answering based on document content.
POST
/
v1
/
chat
/
completion
Chat Completion
curl --request POST \
--url https://api.reportify.cn/v1/chat/completion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"folder_ids": [],
"doc_ids": [],
"categories": [],
"markets": [],
"institutions": [],
"symbols": [],
"tags": {},
"start_date": "<string>",
"end_date": "<string>",
"min_score": 123,
"extended_filters": [
{}
],
"mode": "concise",
"session_id": "",
"stream": true
}
'import requests
url = "https://api.reportify.cn/v1/chat/completion"
payload = {
"query": "<string>",
"folder_ids": [],
"doc_ids": [],
"categories": [],
"markets": [],
"institutions": [],
"symbols": [],
"tags": {},
"start_date": "<string>",
"end_date": "<string>",
"min_score": 123,
"extended_filters": [{}],
"mode": "concise",
"session_id": "",
"stream": True
}
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: '<string>',
folder_ids: [],
doc_ids: [],
categories: [],
markets: [],
institutions: [],
symbols: [],
tags: {},
start_date: '<string>',
end_date: '<string>',
min_score: 123,
extended_filters: [{}],
mode: 'concise',
session_id: '',
stream: true
})
};
fetch('https://api.reportify.cn/v1/chat/completion', 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.reportify.cn/v1/chat/completion",
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' => '<string>',
'folder_ids' => [
],
'doc_ids' => [
],
'categories' => [
],
'markets' => [
],
'institutions' => [
],
'symbols' => [
],
'tags' => [
],
'start_date' => '<string>',
'end_date' => '<string>',
'min_score' => 123,
'extended_filters' => [
[
]
],
'mode' => 'concise',
'session_id' => '',
'stream' => true
]),
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.reportify.cn/v1/chat/completion"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\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.reportify.cn/v1/chat/completion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/chat/completion")
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\": \"<string>\",\n \"folder_ids\": [],\n \"doc_ids\": [],\n \"categories\": [],\n \"markets\": [],\n \"institutions\": [],\n \"symbols\": [],\n \"tags\": {},\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_score\": 123,\n \"extended_filters\": [\n {}\n ],\n \"mode\": \"concise\",\n \"session_id\": \"\",\n \"stream\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"message_id": "<string>",
"message": "<string>",
"extra": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}文档问答
URL:/v1/chat/completion方法:
POST描述: 提供基于文档内容的问答服务。
请求参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| query | str | 问题或查询内容。 |
| doc_ids | array[str] | 指定文档 ID 列表,可选,默认为空数组。 |
| mode | str | 响应模式,支持 concise, comprehensive, deepresearch。 |
| categories | array | 文档类别(默认不包含 files),可选值有 financials,transcripts,reports(国内研报),global_research(外资研报),filings,news,socials,files。 |
| institutions | array | 指定机构筛选,如 Morgan Stanley,Seeking Alpha。暂未支持 |
| market | str | 市场区域,默认包括所有市场。可选值有 sz, sh, hk, us。 |
| symbol | str | 股票代码筛选,如 SH:000001,HK:00700,US:AAPL。 |
| tags | dict | 标签数组。 |
| key | str | 标签类型(如 industry, company, person, event)。 |
| value | array | 标签内容数组。 |
| session_id | str | 会话 ID,用于跟踪问答上下文。 |
| stream | bool | 是否使用流式传输响应,默认值为 true,当前只支持 true。 |
- 当 categories 为
files时,可以通过指定tags参数来筛选上传的文件(上传时制定了相应的tags)。
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| type | str | 响应的类型。 |
| message_id | str | 消息唯一 ID。 |
| message | str | 问答内容。 |
| extra | dict | 额外信息。 |
请求示例
cURLcurl -X POST https://api.reportify.cn/v1/chat/completion \
-H "Authorization: Bearer 447460****09c9" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the latest trends in AI?",
"doc_ids": ["1046895208953942016"],
"mode": "research",
"session_id": "session123",
"stream": true
}'
import requests
url = "https://api.reportify.cn/v1/chat/completion"
headers = {
"Authorization": "Bearer 447460****09c9",
"Content-Type": "application/json"
}
payload = {
"query": "What are the latest trends in AI?",
"doc_ids": ["1046895208953942016"],
"mode": "research",
"session_id": "session123",
"stream": True
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
响应示例
data: {"type": "questions", "message_id": "10035660298823686", "message": "", "extra": {"questions": ["特斯拉最近的营收和利润情况如何?", "特斯拉最近的交付量和生产量如何?", "特斯拉最近在市场上的表现如何?"], "in_steps": false}}
data: {"type": "start", "message_id": "10035660298823686", "message": "特斯拉最近业绩表现", "extra": {}}
data: {"type": "info", "message_id": "10035660298823686", "message": "", "extra": {"tool": {"key": "", "query": "特斯拉最近的营收和利润情况如何?\n特斯拉最近的交付量和生产量如何?\n特斯拉最近在市场上的表现如何?", "question": "特斯拉最近的营收和利润情况如何?\n特斯拉最近的交付量和生产量如何?\n特斯拉最近在市场上的表现如何?"}}}
data: {"type": "info", "message_id": "10035660298823686", "message": "", "extra": {"sources": [{"type": "text", "summary": "", "doc": {"doc_id": "1046895208953942016", "title": "Tesla(TSLA) - 2024 Q3 - Quarterly Report", "url": "https://reportify.cn/financials/1046895208953942016"}}]}}
data: {"type": "answer", "message_id": "10035660298823686", "message": "特斯拉最近业绩表现", "extra": {"sources": [{"type": "table", "summary": "", "doc": {"doc_id": "1046895208953942016", "title": "Tesla(TSLA) - 2024 Q3 - Quarterly Report", "url": "https://reportify.cn/financials/1046895208953942016"}}]}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "特斯拉", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "2", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "0", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "2", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "4", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "年", "extra": {}}
......
......
......
data: {"type": "stream", "message_id": "10035660298823686", "message": "渗透率", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "[", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "3", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "7", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "]", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "。", "extra": {}}
data: {"type": "stream", "message_id": "10035660298823686", "message": "", "extra": {}}
data: {"type": "end", "message_id": "10035660298823686", "message": "特斯拉2024年第三季度业绩表现如下:\n- **营收情况**:\n - **总营收**:第三季度总营收为251.8亿美元,同比增长8%。其中,汽车业务营收228.06亿美元,同比增长5%;能源生成和存储业务营收23.76亿美元,同比增长52%;服务及其他业务营收27.9亿美元,同比增长29%[2][9]。\n\n\n - **汽车业务细分**:汽车销售营收188.31亿美元,同比增长1%,主要因Model 3和Model Y现金交付量增加以及Cybertruck交付量上升,同时车辆平均售价降低和产品组合变化部分抵消了增长;汽车监管信贷营收7.39亿美元,同比增长33%,受北美地区信贷需求推动;汽车租赁营收4.46亿美元,同比下降9%,主要因直接销售型租赁交付量降低和租赁买断减少[2][11][18]。\n - **能源生成和存储业务**:营收增长主要由于Megapack和Powerwall的部署增加[36]。\n - **服务及其他业务**:营收增长主要源于非保修维护服务、碰撞修复收入、二手车收入、付费超级充电收入、保险服务收入和零部件销售收入的增加[12]。\n- **利润情况**:\n - **净利润**:第三季度净利润为21.83亿美元,同比增长16.3%。归属于普通股股东的净利润为21.67亿美元,同比增长17.0%[4][6]。\n\n\n - **利润率**:总汽车业务的毛利率从2023年第三季度的18.7%上升至20.4年第三季度的20.1%,主要得益于单位车辆平均综合成本降低、FSD收入和监管信贷收入增加,部分被车辆平均售价降低所抵消[31]。\n- **现金流情况**:\n - **经营活动现金流**:九个月内提供的经营活动净现金为101.09亿美元,较2023年同期的88.86亿美元增加12.2亿美元,主要因净经营资产和负债的有利变化,部分被净收入(不含非现金费用、收益和损失)的减少所抵消[7][17]。\n- **生产与交付情况**:\n - **汽车生产与交付**:2024年前三季度生产约131.4万辆消费类汽车,交付约129.4万辆。专注于盈利性增长,包括利用现有工厂和生产线推出新产品、降低成本、提高产能和交付能力等[37]。\n - **能源存储产品部署**:2024年前三季度部署了20.41 GWh的能源存储产品,专注于提高生产和市场渗透率[37]。", "extra": {"return_mode": 1, "agent_mode": 2}}
Authorizations
Enter your Bearer token
Body
application/json
An enumeration.
Available options:
financials, transcripts, reports, news, files, filings, socials, global_research An enumeration.
Available options:
cn, hk, us Show child attributes
Show child attributes
An enumeration.
Available options:
concise, comprehensive, deepresearch ⌘I
