法律

概览

building 26 国 33,103 部法规 / 1,537,422 条,条级混合检索,中英译文与条级抽取。

id: law_idchn:law:刑法 · 引用格式 [中华人民共和国刑法 第266条]

覆盖率与偏差说明。中国民事判决目前只覆盖约 12%,且样本不随机——它跟着 enrichment 队列走。刑事判决 100%。每个 Law / Cases 响应都带 coverage 块;把它的 note 抄进 agent 的 tool description,让它对民事案例的结论加限定。引用格式:[中华人民共和国刑法 第266条] · [(2022)湘0902刑初12号]。每份判决的法律依据都归一成 CN/刑法/266 这样的 law_refs,由此有两条精确路径:lawcases view(法条 → 判决)和 caseslaws view(判决 → 法条)。

  • 建设中:接口形状已定,上游上线后自动变 live。

读一份文档即将上线

GET/v1/law/doc/{law_id}
一份文档,每次一个 view。结构化 view 在 data,文本 view 在 text 并带 token_count。免费样例:chn:law:刑法
viewcredits返回
brief1一部法:三语标题、机关、日期、状态 + 章节树
head2brief + 每章一句摘要 + 条号列表
article3一条:原文/译文/抽取/引用/被引案例数
context3一条 + 前后条 + 所属章
section3一章 (text)
raw5全文 markdown (text)
cases2法条 → 引用它的判决(brief 列表)

参数

参数类型说明
law_id (path) string 必填 文档 id(law_id)。
view brief | head | article | context | section | raw | cases = brief 读哪一层。
article string 可选 view = article | context | cases(该 view 必填)
lang string 可选 view = article
window integer = 2 view = context,默认 2
chapter string 可选 view = section(该 view 必填)
top_k integer = 10 view = cases,默认 10

示例

{ "domain": "law", "id": "chn:law:刑法", "view": "section", "params": { … }, "data": { … } | "text": "…", "token_count": 1834, "truncated": false, "meta": { … } }

批量读即将上线

POST/v1/law/docs
最多 50 个 id,同一个 view。查不到的 id 返回 error: "not_found",不扣费。

参数

参数类型说明
ids string[] 必填 文档 id 列表。
view brief | head | article | context | section | raw | cases = brief 所有 id 共用的 view。

示例

{ "domain": "law", "view": "brief", "docs": [ { "id": "…", "data": { … } }, { "id": "…", "error": "not_found" } ], "meta": { … } }

Facets即将上线

GET/v1/law/facets?field={field}
某个过滤字段的合法值与计数,agent 不用猜。免费。垂域未实现时 404。

参数

参数类型说明
field jurisdiction | law_id | law_type | domain | status | norm_type | effective_at | lang 必填 过滤字段。
limit integer = 50 最多返回多少个值。

示例

{ "domain": "law", "field": "…", "values": [ { "value": "…", "count": 3120 } ], "meta": { … } }

即将上线registered key+ /stream

POST/v1/law/ask
法条 + 判决联合 agentic 问答;响应多 sources.laws / sources.cases 和 coverage。按 effort 计 50 / 100 / 200 credits。加 /stream 走 NDJSON,第一个事件一定是 billing。首个 answer_delta 之前上游失败会退款。

参数

参数类型说明
query string 必填 1–2000 字符。问得具体;要数字就直接问数字。
scope auto | law | case | both = auto
jurisdiction string 可选 ISO3,默认 auto
effort default | high | xhigh = default 检索轮数上限,也决定价格:50 / 100 / 200 credits。套餐限制最高档。
verbose bool = false 返回工具调用轨迹(流式时多 tool_call / tool_result / thinking 事件)。
top_k integer = 10 预取候选数。
stream_answer bool = true 仅流式:false 时只发一个 answer 事件。
max_rounds integer 可选 0–8,覆盖 effort 预设。
force_answer_after number 可选 秒;强制切入作答阶段。
max_answer_tokens integer = 4096 触顶时置 answer_truncated。
language string 可选 回答语言,默认跟随 query。

示例

{ "answer": "… [中华人民共和国刑法 第266条] …", "sources": [ … ], "stats": { "rounds": 1, "elapsed_s": 6.2, "answer_truncated": false }, "coverage"?: { … }, "meta": { "credits": { "charged": 50, … } } }
引用是真的——answer 里的每个 id 都存在于本垂域(格式 [中华人民共和国刑法 第266条])。sources 是召回集,不是引用列表。answer_truncated 表示不完整。

案例

building 中国裁判文书 450 万(目标 1,770 万),结构化 brief(案由/法院/审级/争议焦点/法条/金额/判项)。

id: uuid · 引用格式 [(2022)湘0902刑初12号]

  • 民事判决目前只覆盖约 12% 且非随机;刑事 100%。每个响应带 coverage。
  • 问答走 /v1/law/ask(scope=case)。

读一份文档即将上线

GET/v1/cases/doc/{uuid}
一份文档,每次一个 view。结构化 view 在 data,文本 view 在 text 并带 token_count。免费样例:
viewcredits返回
brief1L1 卡片 ~100 tok
head2全部结构化字段
section3parties / claims / facts / opinion / decision (text)
preview3全文前 N 字 (text)
raw5全文 (text)
laws2判决 → 引用的法条(law 的 article id 列表)

参数

参数类型说明
uuid (path) string 必填 文档 id(uuid)。
view brief | head | section | preview | raw | laws = brief 读哪一层。
section string 可选 view = section(该 view 必填)
characters integer = 3000 view = preview,默认 3000

示例

{ "domain": "cases", "id": "…", "view": "section", "params": { … }, "data": { … } | "text": "…", "token_count": 1834, "truncated": false, "meta": { … } }

批量读即将上线

POST/v1/cases/docs
最多 50 个 id,同一个 view。查不到的 id 返回 error: "not_found",不扣费。

参数

参数类型说明
ids string[] 必填 文档 id 列表。
view brief | head | section | preview | raw | laws = brief 所有 id 共用的 view。

示例

{ "domain": "cases", "view": "brief", "docs": [ { "id": "…", "data": { … } }, { "id": "…", "error": "not_found" } ], "meta": { … } }

Facets即将上线

GET/v1/cases/facets?field={field}
某个过滤字段的合法值与计数,agent 不用猜。免费。垂域未实现时 404。

参数

参数类型说明
field case_nature | cause | province | city | court_level | trial_round | decided_at | law_refs | amount | sentence_months | probation 必填 过滤字段。
limit integer = 50 最多返回多少个值。

示例

{ "domain": "cases", "field": "…", "values": [ { "value": "…", "count": 3120 } ], "meta": { … } }