Berget AI OCR API
Document OCR — extract text and structure from PDFs and images as markdown, with query-guided focused extraction
Document OCR — extract text and structure from PDFs and images as markdown, with query-guided focused extraction
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/berget-ai:berget-ai-ocr-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Berget Ai OCR API
version: 1.0.0
contact:
name: Berget AI Support
email: support@berget.ai
url: https://berget.ai/support
license:
name: Proprietary
url: https://berget.ai/terms
description: 'Operations tagged OCR across 2 of this provider''s published API definitions: berget-ai-openapi.json, berget-ai-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.berget.ai
description: Production API
- url: https://api.stage.berget.ai
description: Stage API
tags:
- name: OCR
description: Document OCR — extract text and structure from PDFs and images as markdown, with query-guided focused extraction
paths:
/v1/ocr:
post:
tags:
- OCR
summary: Process a document with OCR
description: 'Extract text and structure from documents (PDF, DOCX, XLS, images) and return
markdown. Whole-document batch processing on our GPU cluster with per-page
routing: pages with a usable text layer are copied verbatim, scanned pages are
transcribed by our vision model.
**Focused OCR**: pass `query` to select only pages matching the text
(semantic + visual matching). Matched pages (with neighbours) come back as
`## Sida N`-prefixed sections; per-page decisions are returned in
`json_content.pipeline.matched[]`. On a total miss the full document is
returned — content is never silently dropped.
**Limits**: 50 MB file (recommended async for documents >10 pages), 500 pages,
10 requests/min. Async jobs are polled on `/v1/ocr/result/{taskId}`.'
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
document:
type: object
properties:
type:
type: string
enum:
- document
- image
url:
type: string
format: uri
description: HTTP(S) URL of the document (backend downloads it server-side, max 100 MB)
required:
- type
- url
async:
type: boolean
default: false
description: true → return a taskId and poll /v1/ocr/result/{taskId} (recommended for >10 pages)
query:
type: string
description: 'Focused OCR: only pages matching this text are returned.'
example: utsläpp av växthusgaser Scope 1 2 3
options:
type: object
properties:
doOcr:
type: boolean
default: true
description: Skip the OCR step (text-layer pages only)
outputFormat:
type: string
enum:
- md
- json
default: md
tableMode:
type: string
enum:
- accurate
- fast
default: accurate
required:
- document
responses:
'200':
description: Extracted content
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: Markdown of the extracted content (Sida-N-sections for query focus)
metadata:
type: object
properties:
filename:
type: string
fileType:
type: string
pageCount:
type: number
processingTime:
type: number
description: milliseconds
usage:
type: object
properties:
characters:
type: number
pages:
type: number
'202':
description: Async processing started (taskId + resultUrl)
'402':
description: Insufficient wallet balance
'413':
description: File exceeds the 50 MB / 500-page limits
'429':
description: Rate limit exceeded (10 requests/min)
operationId: postV1Ocr
x-operation-id-source: derived
servers:
- url: https://api.berget.ai
description: Production API
- url: https://api.stage.berget.ai
description: Stage API
/v1/ocr/result/{taskId}:
get:
tags:
- OCR
summary: Fetch an async OCR job result
description: Poll with the taskId from an async POST /v1/ocr. Returns 202 with Retry-While pending, 200 with the result when done.
security:
- BearerAuth: []
parameters:
- name: taskId
in: path
required: true
schema:
type: string
responses:
'200':
description: Job completed — same shape as the sync response plus status
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: Markdown of the extracted content (Sida-N-sections for query focus)
metadata:
type: object
properties:
filename:
type: string
fileType:
type: string
pageCount:
type: number
processingTime:
type: number
description: milliseconds
usage:
type: object
properties:
characters:
type: number
pages:
type: number
'202':
description: Still processing (honor Retry-After)
'404':
description: Unknown taskId
operationId: getV1OcrResultByTaskId
x-operation-id-source: derived
servers:
- url: https://api.berget.ai
description: Production API
- url: https://api.stage.berget.ai
description: Stage API
/v1/ocr/pages:
post:
tags:
- OCR
summary: Raw per-page text from a PDF (no OCR)
description: Cheap text-layer extraction — only returns pages that already have embedded text. Prints/OCR-ed pages are skipped.
security:
- BearerAuth: []
responses:
'200':
description: Per-page texts
operationId: postV1OcrPages
x-operation-id-source: derived
servers:
- url: https://api.berget.ai
description: Production API
- url: https://api.stage.berget.ai
description: Stage API
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT or API key
description: 'Bearer token or API key. Pass either a JWT token or an API key (sk_ber_*) in the Authorization header as: Bearer <token>'
x-refined-from:
- berget-ai-openapi.json
- berget-ai-openapi.yml