Bailian CLI ParseX: parse documents and media, query results, and extract fields with a JSON Schema and source citations.
Use ParseX from the terminal to parse documents or media, and extract structured fields from documents or existing parse results with a JSON Schema.
See Use the CLI for feature-page usage.
Submit a document or media parsing job. Requires API Key authentication.
Usage
Example: Submit a document and output JSON
Example: Use a processing file and output Markdown
Example
Query parsing status, results, or a result slice. Requires API Key authentication.
Usage
Example: Query a single result
Example: Poll until the job finishes
Extract fields from a document or existing parse result with a JSON Schema. Requires API Key authentication.
Usage
Example: Extract fields from a document with a schema
Example: Reuse an existing parse result and disable inference
Example
Query extraction status, fields, and citations. Requires API Key authentication.
Usage
Example: Poll for extraction results
ParseX uses a workspace-specific API. Provide a workspace with
--workspace-id, BAILIAN_WORKSPACE_ID, or workspace_id in the Profile. Availability depends on the workspace and the actual rollout.Parse documents or media
bl parsex parse submit
Submit a document or media parsing job. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-url <url> | string | yes | Accessible source HTTP(S) URL |
--file-name <name> | string | no | File name; alternative to --file-name-extension |
--file-name-extension <extension> | string | no | File extension, e.g. pdf |
--config-id <id> | string | no | Saved ParseX configuration ID |
--processing-file <path> | string | no | JSON object file for the API processing field |
--oss-config-file <path> | string | no | JSON file with OSS credentials; submit also requires bucket and endpoint |
--output-file-format <markdown> | array | no | Result file format (markdown) |
--layout-table-format <markdown|html> | string | no | Table format inside Markdown results |
--workspace-id <id> | string | no | Workspace ID for the API endpoint (or set BAILIAN_WORKSPACE_ID) |
processing.json:
- Returns
data.biz_idwithout waiting; query it withparse result --follow. - The input must be an accessible HTTP(S) URL, including a signed OSS URL. This API does not support local uploads.
- Inline
processingconfiguration takes precedence over--config-id. For media, usemedia_processing_configto configure diarization, synopsis, and frame extraction. --dry-runmakes no business requests and redacts OSS credentials and URL query strings.
bl parsex parse result
Query parsing status, results, or a result slice. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--biz-id <id> | string | yes | biz_id returned by the matching submit command |
--follow | switch | no | Poll until success or failure; Ctrl-C stops only local polling |
--interval <seconds> | number | no | Polling interval, 1–3600 seconds (default: 2; --follow only) |
--poll-timeout <seconds> | number | no | Total polling deadline, 1–86400 seconds (default: 600; --follow only) |
--step-start <n> | number | no | Slice offset for layouts or media segments (service default: 0) |
--step-size <n> | number | no | Slice size (service default: 0) |
--oss-config-file <path> | string | no | JSON file with OSS credentials |
--workspace-id <id> | string | no | Workspace ID for the API endpoint (or set BAILIAN_WORKSPACE_ID) |
- A single query preserves the complete API response and exits 0 even when the job failed.
--followemits one terminal response on stdout and progress on stderr; failure exits 1, timeout 5, and Ctrl-C 130.- Resume with the same
biz_id; stopping local polling does not cancel the server-side job. --followwaits only for the requested slice, not all slices. Advance--step-startexplicitly to retrieve more layouts or media segments.ResultNotReadyis polled again only with--follow.--timeoutcontrols each HTTP request;--poll-timeoutcovers the whole polling loop.
Extract structured fields
bl parsex extract submit
Extract fields from a document or existing parse result with a JSON Schema. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-url <url> | string | no | Accessible source file URL; alternative to --parsed-file-biz-id |
--parsed-file-biz-id <id> | string | no | Completed parse job biz_id; alternative to --file-url |
--schema-file <path> | string | no | JSON Schema object file |
--processing-file <path> | string | no | JSON object file containing the API processing field |
--config-id <id> | string | no | Saved ParseX configuration ID |
--file-name <name> | string | no | File name; alternative to --file-name-extension |
--file-name-extension <extension> | string | no | File extension, e.g. pdf |
--user-prompt <text> | string | no | Extraction instruction; used with --schema-file |
--citation-required <boolean> | boolean | no | Include source citations (service default: true) |
--allow-inference <boolean> | boolean | no | Allow inference (service default: false) |
--oss-config-file <path> | string | no | JSON file with OSS credentials; submit also requires bucket and endpoint |
--workspace-id <id> | string | no | Workspace ID for the API endpoint (or set BAILIAN_WORKSPACE_ID) |
schema.json:
- Returns
data.biz_idwithout waiting; query it withextract result --follow. - The input must be an accessible HTTP(S) URL, including a signed OSS URL. Local uploads are not supported. Inline
processingconfiguration takes precedence over--config-id. - Send the schema as a JSON object, not a JSON string.
extractdoes not support audio or video. Reused parse results must still be retained by the service.
bl parsex extract result
Query extraction status, fields, and citations. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--biz-id <id> | string | yes | biz_id returned by the matching submit command |
--follow | switch | no | Poll until success or failure; Ctrl-C stops only local polling |
--interval <seconds> | number | no | Polling interval, 1–3600 seconds (default: 2; --follow only) |
--poll-timeout <seconds> | number | no | Total polling deadline, 1–86400 seconds (default: 600; --follow only) |
--oss-config-file <path> | string | no | JSON file with OSS credentials |
--workspace-id <id> | string | no | Workspace ID for the API endpoint (or set BAILIAN_WORKSPACE_ID) |
- A single query preserves the complete API response and exits 0 even when the job failed.
--followemits one terminal response on stdout and progress on stderr; failure exits 1, timeout 5, and Ctrl-C 130.- Resume with the same
biz_id; stopping local polling does not cancel the server-side job.