Public-information risk screening
The risk agent reuses the web-search channel behind POST /v1/search and generates a cited public-information screening report. It no longer calls Fahai identity, query or export APIs.
A supplied legal name can be searched without claiming registry verification. identity_status=matched requires a unique labelled name and checksum-valid credit code in an official document. Otherwise a supplied name is user_provided. A credit code without a resolved legal name returns company_unresolved.
Nine search dimensions remain: cpws, zxgg, shixin, ktgg, fygg, sifacdk, satparty_qs, satparty_chufa, satparty_fzc. Status is evidence_found (unverified leads), unverified, or failed. Cards require an official source domain and an exact company-name mention; party roles, relationships, dates and outcomes still need verification.
report.source=web_search, rating=unknown, score=null, and hit_count=null. evidence_count counts displayed web leads, not cases or risks. Missing evidence does not establish no risk, and historical records do not establish current status.
Each successful identity or dimension search is billed at the actual doubao-web-search rate, including an empty result. The 24-hour cache avoids search fees. The writer is billed by tokens; the former risk-agent/Fahai per-call rate is not used. Completed searches remain billable if identity cannot be resolved or report writing fails.
Use Authorization: Bearer tr-.... Restricted keys must allow risk-agent, doubao-web-search, and, for reports, the configured writer model and their channels. No provider credentials are required from callers.
Messages accept string content and require a user message; the last 10 messages are used. identify=true only checks identity with at most one search; stream=true returns SSE. Historical reports remain readable; new search caches are separate from old Fahai data. Alias: /v1/agent/risk/chat/completion.
Authorization
BearerAuth API key authentication (OpenAI format). Pass in the Authorization header:
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"
}