# Risk agent

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`.

```json
{
  "messages": [{ "role": "user", "content": "查询小米科技有限责任公司的涉诉与涉税风险" }],
  "stream": false
}
```

[API reference](/docs/api/createRiskAgentChatCompletion)
