---
title: "general information extration"
method: POST
path: "/ai/service/v3/entity_extraction"
---

# general information extration

`POST /ai/service/v3/entity_extraction`

智能抽取API已更新至v3， 如需查看旧版API请[点击](https://www.textin.com/document/legacy/open_kie_vlm_engine)

快速调试：请参考[Postman调试教程](/xparse/extract-debug-postman)或[Apifox调试教程](/xparse/extract-debug-apifox)

## Request body

- object
  - `file` object, required — 文件信息
    - `file_base64` string — 待处理文件的base64编码，与file_url二选一
    - `file_url` string — 待处理文件的url链接，与file_base64二选一，如果存在file_base64则会被忽略
    - `file_name` string — 用于前端展示的文件名，可选
  - `schema` object, required — 抽取数据结构，参考[JSON schema说明](/xparse/extract-quickstart-v3#json-schema-结构说明和抽取指南)
  - `parse_options` ParseOptions — 解析阶段参数
    - `page_start` integer — 从第几页开始抽取，默认为1
    - `page_count` integer — 要进行抽取的pdf页数，默认为100页
    - `get_image` 'none' | 'both' | 'page' | 'objects' — 获取图片，默认为objects
    - `crop_dewarp` 0 | 1 — 是否进行切边矫正处理
    - `remove_watermark` 0 | 1 — 是否进行去水印处理
    - `parse_mode` 'auto' | 'scan' | 'lite' | 'parse' | 'vlm' — 文档的解析模式，默认为scan模式。 - auto 由引擎自动选择，适用范围最广 - scan 文档统一当成图片解析（如pdf每一页都当成图片解析） - lite 轻量版，只输出表格和文字结果 - parse 仅电子档文字解析，速度最快 - vlm 视觉语言模型解析模式
    - `formula_level` 0 | 1 | 2 — 公式识别等级
    - `table_flavor` 'md' | 'html' | 'none'
    - `pdf_pwd` string — 当pdf为加密文档时，需要提供密码。 备注：对前端封装该接口时，需要自行对密码进行安全防护
  - `extract_options` ExtractOptions — 高级抽取控制
    - `generate_citations` boolean — 是否生成引用信息
    - `stamp` boolean — 是否调用印章识别

## Response `200`

返回结果

- object
  - `code` 200 | 40101 | 40102 | 40103 | 40003 | 40004 | 40007 | 40008 | 40302 | 40303 | 40304 | 40305 | 40306 | 40400 | 40422 | 40423 | 40424 | 40425 | 40428 | 500 | 50011 | 50012 | 50207, required — 状态码 - 200: Success (成功) - 40101: x-ti-app-id 或 x-ti-secret-code 为空 - 40102: x-ti-app-id 或 x-ti-secret-code 无效，验证失败 - 40103: 客户端IP不在白名单 - 40003: 余额不足，请充值后再使用 - 40004: Parameter error (参数错误，请检查入参） - 40007: 机器人不存在或未发布 - 40008: 机器人未开通，请至市场开通后重试 - 40302: 上传文件大小不符，文件大小不超过 50M - 40303: 文件类型不支持，接口会返回实际检测到的文件类型，如“当前文件类型为.gif” - 40304: 图片尺寸不符，长宽比小于2的图片宽高需在20～20000像素范围内，其他图片的宽高需在20～10000像素范围内 - 40305: File not uploaded (识别文件未上传） - 40306: qps超过限制 - 40400: 无效的请求链接，请检查链接是否正确 - 40422: The file is corrupted (文件损坏) - 40423: Password required or incorrect password (PDF密码错误) - 40424: Page number out of range (页面设置超出文件范围） - 40425: The input file format is not supported (输入文件格式不支持） - 40428: Process office file failed (word和ppt转pdf失败或者超时) - 500: Engine failed (服务器内部错误） - 50011: LLM Connection Failed （访问大模型超时） - 50012: LLM Engine Failed (大模型引擎错误） - 50207: Partial failed (部分页面解析失败)
  - `message` string, required — 成功或错误信息
  - `version` string, required — 版本号
  - `duration` integer — 总耗时(ms)
  - `x_request_id` string — 请求ID
  - `status` string — 处理状态
  - `result` object
    - `success_count` integer — 成功处理的页数
    - `extracted_schema` object — 结构化抽取结果，根据用户定义的schema进行抽取的简化键值对结构 由于使用结构化抽取，具体的字段名称和数据类型由用户的schema决定，无法预先确定
    - `citations` object — 带坐标信息的抽取结果，包含详细的位置信息和边界框数据，用于高级处理场景 由于使用结构化抽取，具体的字段名称无法预先确定，但每个字段值都遵循统一的结构格式，包含抽取值、页码信息和详细的坐标数据
    - `pages` PageInfo[] — 文档每页的处理信息
      - `page_number` integer, required — 页码
      - `image_id` string — 页面图片ID，用于下载图片
      - `height` integer — 页面高度
      - `width` integer — 页面宽度
      - `angle` 0 | 90 | 180 | 270 — 页面角度
      - `status` string, required — 页面处理状态
      - `durations` number, required — 页面处理耗时(ms)
    - `stamps` StampInfo[] — 印章识别结果
      - `color` '红色' | '蓝色' | '黑色' | '其他' — 当前印章颜色 - 红色 - 蓝色 - 黑色 - 其他
      - `position` number[] — 印章的坐标信息
      - `stamp_shape` '圆章' | '椭圆章' | '方章' | '三角章' | '菱形章' | '其他' — 当前印章形状 - 圆章 - 椭圆章 - 方章 - 三角章 - 菱形章 - 其他
      - `type` '公章' | '个人章' | '专用章' | '其他' | '合同专用章' | '财务专用章' | '发票专用章' | '业务专用章' — 当前印章类型 - 公章 - 个人章 - 专用章 - 其他 - 合同专用章 - 财务专用章 - 发票专用章 - 业务专用章
      - `value` string — 印章的文本内容
  - `part_durations` object — 各阶段耗时统计
    - `parse_duration` integer — 解析耗时(ms)
    - `retrieve_duration` integer — 检索耗时(ms)
    - `prompt_duration` integer — 提示词处理耗时(ms)
    - `llm_duration` integer — 大模型推理耗时(ms)
    - `format_duration` integer — 格式化耗时(ms)

---

[API](https://skmtc.dev/textin/apis/api.md) · [All operations](https://skmtc.dev/textin/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/textin/api/revisions/80992397e92f/schema)
