Nanonets · Capability

Nanonets OCR API — Prediction

Nanonets OCR API — Prediction. Sync and async prediction over files and URLs against a custom Nanonets OCR model, plus retrieval of prior predictions by file or page.

Nanonets OCR API — Prediction is a Naftiko capability published by Nanonets, one of 5 capabilities the APIs.io network indexes for this provider. It bundles 4 operations across the POST method rooted at /v1/ocr.

The capability includes 2 read-only operations and 3 state-changing operations. Lead operation: Sync OCR prediction over uploaded file(s). Can be deployed as a REST endpoint, MCP tool, or Agent Skill via Naftiko.

Tagged areas include Nanonets, OCR, and Prediction.

Run with Naftiko NanonetsOCRPrediction

What You Can Do

POST
Predictfile — Sync OCR prediction over uploaded file(s).
/v1/ocr/predict-file
POST
Predictfileasync — Async OCR prediction over uploaded file(s).
/v1/ocr/predict-file-async
POST
Predicturls — Sync OCR prediction over URLs.
/v1/ocr/predict-urls
POST
Predicturlsasync — Async OCR prediction over URLs.
/v1/ocr/predict-urls-async

MCP Tools

nanonets-predict-file

Sync OCR prediction over uploaded file(s).

nanonets-predict-file-async

Async OCR prediction over uploaded file(s).

nanonets-predict-urls

Sync OCR prediction over URLs.

nanonets-get-prediction-by-file

Retrieve prediction for a single file.

read-only idempotent
nanonets-list-prediction-files

Retrieve all predictions within a window.

read-only idempotent

Capability Spec

ocr-prediction.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Nanonets OCR API — Prediction
  description: 'Nanonets OCR API — Prediction. Sync and async prediction over files and URLs against a custom
    Nanonets OCR model, plus retrieval of prior predictions by file or page.'
  tags:
  - Nanonets
  - OCR
  - Prediction
  created: '2026-05-25'
  modified: '2026-05-25'
binds:
- namespace: env
  keys:
    NANONETS_API_KEY: NANONETS_API_KEY
capability:
  consumes:
  - type: http
    namespace: ocr-prediction
    baseUri: https://app.nanonets.com/api/v2
    description: Nanonets OCR prediction surface — sync and async endpoints plus retrieval.
    resources:
    - name: label-file
      path: /OCR/Model/{model_id}/LabelFile/
      operations:
      - name: predictFile
        method: POST
        description: Sync OCR prediction over uploaded file(s).
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: file, in: body, type: object, required: true, description: 'Multipart file payload.' }
    - name: label-file-async
      path: /OCR/Model/{model_id}/LabelFile/Async/
      operations:
      - name: predictFileAsync
        method: POST
        description: Async OCR prediction over uploaded file(s).
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: file, in: body, type: object, required: true }
    - name: label-urls
      path: /OCR/Model/{model_id}/LabelUrls/
      operations:
      - name: predictUrls
        method: POST
        description: Sync OCR prediction over publicly accessible URLs.
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: body, in: body, type: object, required: true }
    - name: label-urls-async
      path: /OCR/Model/{model_id}/LabelUrls/Async/
      operations:
      - name: predictUrlsAsync
        method: POST
        description: Async OCR prediction over publicly accessible URLs.
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: body, in: body, type: object, required: true }
    - name: inference-by-file
      path: /Inferences/Model/{model_id}/InferenceRequest/{request_file_id}
      operations:
      - name: getPredictionByFileId
        method: GET
        description: Retrieve prediction for a single file.
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: request_file_id, in: path, type: string, required: true }
    - name: inference-by-page
      path: /Inferences/Model/{model_id}/InferenceRequest/{request_file_id}/page/{page_id}
      operations:
      - name: getPredictionByPageId
        method: GET
        description: Retrieve prediction for a single page.
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: request_file_id, in: path, type: string, required: true }
        - { name: page_id, in: path, type: string, required: true }
    - name: inference-list
      path: /Inferences/Model/{model_id}/InferenceRequest/
      operations:
      - name: listPredictionFiles
        method: GET
        description: Retrieve all predictions within a day-since-epoch window.
        outputRawFormat: json
        outputParameters:
        - { name: result, type: object, value: $. }
        inputParameters:
        - { name: model_id, in: path, type: string, required: true }
        - { name: start_day_interval, in: query, type: integer, required: true }
        - { name: current_batch_day, in: query, type: integer, required: true }
    authentication:
      type: basic
      username: '{{env.NANONETS_API_KEY}}'
      password: ''
  exposes:
  - type: rest
    namespace: ocr-prediction-rest
    port: 8080
    description: REST adapter for the Nanonets OCR prediction surface.
    resources:
    - path: /v1/ocr/predict-file
      name: predict-file
      operations:
      - { method: POST, name: predictFile, description: 'Sync OCR prediction over uploaded file(s).', call: ocr-prediction.predictFile,
          with: { model_id: rest.body.model_id, file: rest.body.file } }
    - path: /v1/ocr/predict-file-async
      name: predict-file-async
      operations:
      - { method: POST, name: predictFileAsync, description: 'Async OCR prediction over uploaded file(s).',
          call: ocr-prediction.predictFileAsync, with: { model_id: rest.body.model_id, file: rest.body.file } }
    - path: /v1/ocr/predict-urls
      name: predict-urls
      operations:
      - { method: POST, name: predictUrls, description: 'Sync OCR prediction over URLs.', call: ocr-prediction.predictUrls,
          with: { model_id: rest.body.model_id, body: rest.body.body } }
    - path: /v1/ocr/predict-urls-async
      name: predict-urls-async
      operations:
      - { method: POST, name: predictUrlsAsync, description: 'Async OCR prediction over URLs.', call: ocr-prediction.predictUrlsAsync,
          with: { model_id: rest.body.model_id, body: rest.body.body } }
  - type: mcp
    namespace: ocr-prediction-mcp
    port: 9090
    transport: http
    description: MCP adapter exposing Nanonets OCR prediction as tools.
    tools:
    - { name: nanonets-predict-file, description: 'Sync OCR prediction over uploaded file(s).', hints: { readOnly: false,
          destructive: false, idempotent: false }, call: ocr-prediction.predictFile, with: { model_id: tools.model_id,
          file: tools.file } }
    - { name: nanonets-predict-file-async, description: 'Async OCR prediction over uploaded file(s).', hints: {
          readOnly: false, destructive: false, idempotent: false }, call: ocr-prediction.predictFileAsync,
        with: { model_id: tools.model_id, file: tools.file } }
    - { name: nanonets-predict-urls, description: 'Sync OCR prediction over URLs.', hints: { readOnly: false,
          destructive: false, idempotent: false }, call: ocr-prediction.predictUrls, with: { model_id: tools.model_id,
          body: tools.body } }
    - { name: nanonets-get-prediction-by-file, description: 'Retrieve prediction for a single file.', hints: {
          readOnly: true, destructive: false, idempotent: true }, call: ocr-prediction.getPredictionByFileId,
        with: { model_id: tools.model_id, request_file_id: tools.request_file_id } }
    - { name: nanonets-list-prediction-files, description: 'Retrieve all predictions within a window.', hints: {
          readOnly: true, destructive: false, idempotent: true }, call: ocr-prediction.listPredictionFiles,
        with: { model_id: tools.model_id, start_day_interval: tools.start_day_interval, current_batch_day: tools.current_batch_day } }