Do not expect a parsed document back from the upload call. Poll the job status endpoint until it reports success, then fetch the result. And stick to one endpoint generation for the entire flow: if you use the /api/v1 files API, do not also call the legacy /api/parsing upload or markdown endpoints. That mix is a documented real-world cause of empty or garbled output.

Context: Official docs (Using the REST API): documents that parsing is async by design. You POST a file to /api/parsing/upload, get back a job id, poll /api/parsing/job/[job_id] until the status flips to success, and only then fetch /result/markdown. Gotcha that trips agents: the docs page itself still shows the older /api/parsing/... endpoints, and several community reports confirm that mixing those with newer SDK or /api/v1 flows silently produces garbage or empty results. Pick one endpoint generation and use it for the whole flow.