公开信息风控会话
风控智能体复用 POST /v1/search 的联网搜索渠道,查询企业公开网页线索,由整理模型生成带来源链接的报告。当前不调用法海工商、query 或 export 接口。
企业全称可直接用于检索;只有官方网页中标注的企业名称与有效信用代码唯一对应时,identity_status=matched。名称未核实返回 user_provided,不冒充工商登记确认。仅提供信用代码且无法对应企业名称时返回 company_unresolved。
保留九个检索维度:cpws、zxgg、shixin、ktgg、fygg、sifacdk、satparty_qs、satparty_chufa、satparty_fzc。维度状态为 evidence_found(待核实线索)、unverified(未确认)或 failed。网页样本仅接受官方域名及目标企业全称匹配,仍需核实案件角色、主体关系、日期和裁判结果。
report.source=web_search,rating=unknown,score=null,hit_count=null。evidence_count 仅为展示的网页线索数,不是案件总数或风险数量。未找到证据不代表无风险,历史记录不证明当前状态。
企业识别和各维度的每次成功搜索均按 doubao-web-search 的实际价格计费;空搜索结果也算成功调用。缓存有效期 24 小时,命中不收搜索费。整理模型按 token 计费;不再按原法海 risk-agent 单价收费。即使识别未匹配或整理失败,已完成的搜索仍按次结算。
鉴权 Authorization: Bearer tr-...。受限密钥须允许 risk-agent、doubao-web-search,生成报告时还需允许配置的整理模型及对应渠道。调用方无需传数据源凭据。
messages 只接受字符串 content,至少一条 user;网关使用最近 10 条历史。identify=true 仅核对主体,最多发起一次搜索;stream=true 返回 SSE。旧报告历史可读取,新搜索缓存与旧法海缓存隔离。兼容别名 /v1/agent/risk/chat/completion。
Authorization
BearerAuth API 密钥认证(OpenAI 格式)。在 Authorization 请求头中传入:
Authorization: Bearer tr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X post "https://api.xrtoken.net/v1/agent/risk/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "查询小米科技有限责任公司的涉诉与涉税风险" } ], "stream": false }'{
"id": "string",
"object": "chat.completion",
"model": "risk-agent",
"company": {
"keyword": "string",
"resolved_name": "string",
"credit_code": "string",
"status": "string",
"identity_status": "matched",
"sources": [
{
"title": "string",
"url": "http://example.com"
}
]
},
"report": {
"source": "web_search",
"rating": "unknown",
"score": null,
"summary": "string",
"fetched_at": 0,
"coverage": {
"total": 0,
"queried": 0,
"failed": 0,
"with_evidence": 0,
"unverified": 0
},
"warnings": [
"string"
],
"dimensions": [
{
"domain": "sifa",
"data_type": "cpws",
"label": "string",
"status": "evidence_found",
"hit_count": null,
"evidence_count": 0,
"fetched_at": 0,
"samples": [
{
"entry_id": "string",
"title": "string",
"date": "string",
"source_type": "string",
"source_url": "http://example.com",
"excerpt": "string",
"page_published_at": "string",
"verification_status": "unverified",
"retrieval_method": "search_api",
"fields_missing": [
"string"
]
}
]
}
]
},
"choices": [
{
"index": 0,
"message": {
"role": "string",
"content": "string"
},
"finish_reason": "string"
}
],
"cards": [
{
"card_type": "risk_summary",
"rating": "unknown",
"score": null,
"title": "string",
"subtitle": "string",
"credit_code": "string",
"summary": "string",
"source": "string",
"domain": "sifa",
"data_type": "string",
"label": "string",
"status": "string",
"hit_count": null,
"evidence_count": 0,
"fetched_at": 0,
"source_type": "string",
"samples": [
{
"entry_id": "string",
"title": "string",
"date": "string",
"source_type": "string",
"source_url": "http://example.com",
"excerpt": "string",
"page_published_at": "string",
"verification_status": "unverified",
"retrieval_method": "search_api",
"fields_missing": [
"string"
]
}
]
}
],
"usage": {
"query_calls": 0,
"query_cached": true,
"query_request_ids": [
"string"
],
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}{
"error": {
"message": "string",
"code": "string"
},
"request_id": "string"
}