Prerequisites
- Subscription key: A key for the API you plan to use. The optical character recognition (OCR) API and the Document Retrieval MCP API have separate subscriptions. To get a key, contact your Backbase support team.
- Document URL: A URL that the service can download. Use a public HTTPS URL, an Azure Blob Storage shared access signature (SAS) URL, or a blob in a container that your installation allows. To confirm which containers your installation allows, contact your Backbase support team. For details, see Document sources.
Call the OCR API
Use the following operations to get document text.Convert a PDF or image
To convert a PDF or image to markdown, send the file URL to the/convert endpoint:
metadata.mode shows the mode that produced the result.
Fetch a text file
To fetch a TXT, JSON, CSV, MD, or XML file, send the file URL to the/text endpoint:
metadata is null:
Connect an MCP client
The Document Retrieval MCP server uses the Streamable HTTP transport at$GATEWAY_URL/document-retrieval-mcp/v0/mcp. Send your Document Retrieval MCP API key in the api-key header.
- FastMCP client
- Cursor
Troubleshooting
401: Access denied due to missing or invalid subscription key
401: Access denied due to missing or invalid subscription key
Cause: The request has no
api-key header, or the key belongs to a different API.Solution: Send the key for the API you’re calling. The OCR API and the Document Retrieval MCP API use separate subscriptions.404: Resource not found
404: Resource not found
Cause: The path is missing the version segment.Solution: Include
/v0 in the path, for example /ocr/v0/convert or /document-retrieval-mcp/v0/mcp.400: Unsupported file type, or container not allowed on POST /text
400: Unsupported file type, or container not allowed on POST /text
Cause: The file extension isn’t supported by the endpoint.
POST /text also returns 400 when the blob container isn’t allowed and the URL has no SAS token.Solution: Check Supported file formats. Use /convert for PDFs and images and /text for text files. For blobs in other containers, pass a SAS URL. On POST /convert, a failed download of that blob returns 500.413: File exceeds the size limit
413: File exceeds the size limit
Cause: The file is larger than 50 MB.Solution: Split or compress the document before you send it.
429: Rate limit exceeded
429: Rate limit exceeded
Cause: Your subscription exceeded its rate limit.Solution: Wait for the period in the
Retry-After header and retry. If you need higher throughput, contact your Backbase support team.500: Internal server error
500: Internal server error
Cause: The service couldn’t download the file, or both OCR modes failed. Common reasons are a URL that isn’t publicly reachable, an expired SAS token, or a file that doesn’t exist. On
POST /convert, a blob outside the allowlist returns 500 when the HTTPS download fails.Solution: Check that you can download the file from the URL yourself. If the URL works and the error persists, contact your Backbase support team.