POST
/
compare
Compare Cardinal results against a baseline
curl --request POST \
  --url https://api.trycardinal.ai/compare \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'fileUrl=<string>' \
  --form imageMetadata=false \
  --form signatureDetect=false \
  --form barcodeDetect=false \
  --form densePdfDetect=false \
  --form startPage=1 \
  --form ephemeral=false \
  --form markdown=false \
  --form 'originalResults=<string>' \
  --form file=@example-file
{
  "dashboard_url": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
file
file
required

PDF or image file to upload (required if no fileUrl). Allowed: .pdf, .jpg, .jpeg, .png

fileUrl
string<uri>

Publicly accessible URL of the file to process (required if no file).

imageMetadata
boolean
default:false

If true, includes image metadata in the response.

signatureDetect
boolean
default:false

If true, includes signature detection in the response.

barcodeDetect
boolean
default:false

If true, includes barcode detection in the response.

densePdfDetect
boolean
default:false

If true, includes dense tables in the response.

startPage
integer
default:1

Page number to start processing from.

Required range: x >= 1
ephemeral
boolean
default:false

If true, results are not persisted; any generated assets are short-lived.

markdown
boolean
default:false

If true, converts tables to Markdown (may be lossy); otherwise tables stay as HTML.

originalResults
string

Optional Markdown string containing baseline results to compare against (e.g., another vendor's OCR output). Stored for the evals dashboard alongside Cardinal results.

Response

Successful compare run. Returns standard processing fields plus a dashboard_url for the evals UI.

The response is the normal /markdown payload merged with { dashboard_url }.

dashboard_url
string<uri>

Link to the evals dashboard view for this comparison.