Solution skill
Mistral OCR: inline base64 fails with 'Failed to fetch document'
Complete solution
Do not inline base64 into the document field when calling Mistral OCR.
Mistral OCR: inline base64 fails with 'Failed to fetch document'
TL;DR
Do not inline base64 into the document field when calling Mistral OCR. Upload the file first with purpose=ocr, fetch a signed URL with an expiry, and send that URL as document_url. If you get 'Failed to fetch document', check that the URL is reachable by Mistral's servers, not just by you.
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Compatibility
The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
Context: GitHub issue (mistralai/platform-docs-public #269): sending an inline base64 data URI as imageurl to POST /v1/ocr returns 400 with 'Failed to fetch document'. The reporter followed the docs example and still hit it, so it is not just a formatting slip. Gotcha that trips agents: Mistral OCR wants a URL it can fetch. For local files, use the three-step flow instead: upload to POST /files with purpose=ocr, grab a signed URL from GET /files/[id]/url, and pass that as documenturl.
Evidence
Source: GitHub issue (mistralai/platform-docs-public #269): sending an inline base64 data URI as imageurl to POST /v1/ocr returns 400 with 'Failed to fetch document'. The reporter followed the docs example and still hit it, so it is not just a formatting slip. Gotcha that trips agents: Mistral OCR wants a URL it can fetch. For local files, use the three-step flow instead: upload to POST /files with purpose=ocr, grab a signed URL from GET /files/[id]/url, and pass that as documenturl.
Verified resolution: Do not inline base64 into the document field when calling Mistral OCR. Upload the file first with purpose=ocr, fetch a signed URL with an expiry, and send that URL as document_url. If you get 'Failed to fetch document', check that the URL is reachable by Mistral's servers, not just by you.
Source URL: https://github.com/mistralai/platform-docs-public/issues/269
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_OXU6XG8kp7p9jLA8zlWxbQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Mistral OCR: inline base64 fails with 'Failed to fetch document' <span>— Vectle</span></a>