> ## Documentation Index
> Fetch the complete documentation index at: https://docs.somark.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SoMark与OXR接入差异

> 对比 SoMark API 与 OXR Free API 的请求参数、响应字段和 CLI 配置。

SoMark API 和 OXR Free API 共用 `/parse/sync`、`/parse/async` 和 `/parse/async_check`。切换服务时，可以复用同步调用和异步轮询流程。服务地址、鉴权和上传限制分别见 [SoMark API 概览](https://docs.somark.ai/api-reference/index.md)和 [OXR Free API](https://docs.somark.ai/open-source-tools/oxr.md#oxr-free-api)。

## 请求参数

| 参数 | SoMark API | OXR Free API |
| - | - | - |
| 文件提交 | 上传 `file` 或提供 `file_url` | 需要直接上传 `file` |
| `output_formats` | 支持 `markdown`、`json` 和 `zip` | 支持 `markdown` 和 `json`。请求 `zip` 会返回参数错误 |
| `feature_config` | 支持跨页拼接、标题层级识别、图片理解等选项 | 仅支持 `keep_header_footer`。启用上述选项时，OXR 会忽略它们并在 `warnings` 中提示 |
| `element_formats.cs` | 化学结构式默认输出图片 | 默认输出 `smiles`。需要图片时设为 `image` |

两种 API 都默认输出 Markdown 和 JSON。完整参数见 [SoMark 同步解析](https://docs.somark.ai/api-reference/endpoint/sync.md)和 [OXR Free 同步解析](https://docs.somark.ai/open-source-tools/oxr/sync.md)。

## 响应字段与错误码

* JSON 中的标题和文本类型在 SoMark 中是 `title`、`text`，在 OXR Free 中是 `Title`、`Text`。按类型筛选时注意大小写。
* OXR Free 的异步结果省略 `record_id`。用提交异步任务时返回的 `task_id` 查询任务结果。
* 两种 API 均以 `code: 0` 表示请求成功。OXR Free 的参数错误码为 `1133`，详情见 `message`。SoMark 的错误码见[错误码参考](https://docs.somark.ai/api-reference/errors.md)。

## CLI、SDK 与自部署

使用 [SoMark CLI 或 SDK](https://docs.somark.ai/cli-sdk/index.md) 调用 OXR Free 时，将 Base URL 设为 `https://free-oxr.somark.ai/api/v1`。使用 CLI 时，`--api-key` 可填 `dummy`。在自己的环境中运行模型，请参阅 [OXR 自部署用法](https://docs.somark.ai/open-source-tools/oxr/index.md#自部署)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.