> For the complete documentation index, see [llms.txt](https://docs.mindee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindee.com/integrations/client-libraries-sdk.md).

# Client Libraries / SDKs

Officially supported client libraries for integrating the Mindee platform.

By using the client libraries you'll be able to integrate faster and lower your maintenance costs.

Some useful tools are also provided, for example PDF processing and image compression.

You can use the client libraries to make API requests following the polling and webhook patterns.

All our client libraries are open-source (MIT license) and hosted on [GitHub](https://github.com/mindee).

Supported languages/frameworks: **Python**, **Node.js** (JS/TS), **PHP**, **Ruby**, **Java**, **.NET** (C#).

## When To Use an SDK?

SDKs are recommended whenever your integration includes application code. They simplify and structure API requests in an idiomatic way,  and include tooling for common file operations. Each SDK also comes with a [CLI utility](/integrations/client-libraries-sdk/command-line-tools-cli.md) for quick testing.

SDKs work for self-hosted applications and development-platform integrations including serverless functions.

#### Serverless Functions

The Node.js SDK is compatible with all major platforms that offer serverless functions. [Install](#installation-instructions) it through `npm` as normal.

Having said that, depending on your platform, other SDKs are compatible:

* **Supabase** Edge Functions: Node.js SDK.
* **Vercel** Functions: Node.js, Python, Ruby SDKs.
* **Firebase** Cloud Functions: Node.js, Python SDKs.
* **AWS** Lambda: Node.js, Python, Java, .NET (C#), Ruby SDKs.\
  PHP with a custom runtime.

## Installation Instructions

{% tabs %}
{% tab title="Python" %}
Requires Python ≥ 3.10. Python ≥ 3.12 is recommended.

Simply install the [PyPi package](https://pypi.org/project/mindee/) using `pip`:

```sh
pip install -U mindee~=5.3
```

{% endtab %}

{% tab title="Node.js" %}
Requires Node.js ≥ 20.1. Node.js ≥ 22 is recommended.

Simply install the [NPM package](https://www.npmjs.com/package/mindee):

```sh
npm install mindee@^5.10.0
```

{% endtab %}

{% tab title="PHP" %}
Requires PHP ≥ 8.1. PHP ≥ 8.3 is recommended.

Simply install the [Packagist package](https://packagist.org/packages/mindee/mindee) using [composer](https://getcomposer.org/):

```sh
php composer.phar require "mindee/mindee:>=3.2"
```

{% endtab %}

{% tab title="Ruby" %}
Requires Ruby ≥ 3.2.

Simply install the [gem](https://rubygems.org/gems/mindee) using:

```shell
gem install mindee -v '~> 5.4'
```

{% endtab %}

{% tab title="Java" %}
Requires Java ≥ 11. Java ≥ 17 is recommended.

Group ID: `com.mindee.sdk`\
Artifact ID: `mindee-api-java`\
Version: `5.5.0` or greater

There are various installation methods, Maven, Gradle, etc:

[Installation Details](https://central.sonatype.com/artifact/com.mindee.sdk/mindee-api-java)
{% endtab %}

{% tab title=".NET" %}
.NET ≥ 8.0 is recommended.

Simply install the [NuGet package](https://www.nuget.org/packages/Mindee) using `dotnet add`:

```sh
dotnet add package Mindee --version 4.8
```

{% endtab %}
{% endtabs %}

Don't see support for your favorite language or framework? [Make a feature request!](https://feedback.mindee.com/?b=682f69c9e2404756e7e68d1c)

## Usage Details

Overall, the steps to using the Mindee service are:

1. [Client Configuration](/integrations/client-libraries-sdk/configure-the-client.md)
   1. Initialize the Mindee client.
   2. Set product/model parameters, the model ID is required.\
      Each product will have different parameters available.
2. [Load and Adjust a File](/integrations/client-libraries-sdk/load-and-adjust-a-file.md)
   1. Load a file from various supported sources: path, bytes, etc.
   2. *Optional*: compress or split the source file before sending.
3. [Send a File or URL](/integrations/client-libraries-sdk/send-a-file-or-url.md)
   1. Send the file or an URL with the product parameters.
4. [Response Processing](/integrations/client-libraries-sdk/process-the-response.md)
   1. Optional: receive the result directly
   2. Optional: receive a webhook.
5. Product-specific processing\
   Each type of model has different result objects.
   1. Handle results extracted from the file
   2. Optional: access field metadata (polygons, confidence score)

## Frequently Asked Questions

<details>

<summary><strong>Can I send requests in parallel?</strong></summary>

Yes. All clients can be used to send requests in parallel.

The exact implementation is left to the user:

* For Node.js, you'll want to use asynchronous processing.
* For all others, you'll want to use threads or processes.

</details>

<details>

<summary><strong>Can I use the v1 and v2 APIs together?</strong></summary>

Yes. Each client library has support for both v1 and v2 APIs.

You'll need to make a separate instance of the client classes:

* .NET and Java, use `MindeeClient` and `MindeeClientV2`
* all others, use `Client` and `ClientV2`

The code to make requests and to process results is **very different** between v1 and v2.

We highly recommend having different files (or even modules) for handling each API version.

</details>

<details>

<summary><strong>Can I send only a specific page of a multi-page PDF?</strong></summary>

Yes. All libraries have support for cutting/extracting PDF pages.

For more information, consult: [Load and Adjust a File](/integrations/client-libraries-sdk/load-and-adjust-a-file.md#manipulate-pdf-pages).

</details>

<details>

<summary><strong>How to stop PDFs with too many pages from being sent?</strong></summary>

**Do not use file size**, a text PDF with 200 pages can be smaller than a single photo.

Much more reliable to count the actual number of pages in the PDF document.

Use the built-in file metadata methods and properties to easily add business rules based on the number of pages (among other data).

For more information, consult: [Load and Adjust a File](/integrations/client-libraries-sdk/load-and-adjust-a-file.md#source-file-metadata).

</details>

<details>

<summary><strong>Which library features are officially supported?</strong></summary>

Anything documented here is officially supported and is considered stable for production use.

Anything in a library that is not documented here, is **not** officially supported and subject to change or removal.

</details>

<details>

<summary><strong>There is a bug with the SDK, what should I do?</strong></summary>

If you are encountering a persistant issue, you should try first:

1. Asking the Docs Assistant for help: <button type="button" class="button primary" data-action="ask" data-icon="gitbook-assistant">Ask a question...</button>
2. Asking your local agent for help by using one of our [SKILL files](/integrations/ai-coding-assistants.md#skill-files)

After this, if you determine (or are told) there is a problem with the SDK itself, the best bet would be to open a bug report on the relevant SDK's GitHub repository:

* **Python**: <https://github.com/mindee/mindee-api-python/issues>
* **Node.js**: <https://github.com/mindee/mindee-api-nodejs/issues>
* **PHP**: <https://github.com/mindee/mindee-api-php/issues>
* **Ruby**: <https://github.com/mindee/mindee-api-ruby/issues>
* **Java**: <https://github.com/mindee/mindee-api-java/issues>
* **.NET**: <https://github.com/mindee/mindee-api-dotnet/issues>

Our SDK engineers will be automatically notified of the new issue.

{% hint style="info" icon="user" %}
Pro and above plans can contact our support teams directly.
{% endhint %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mindee.com/integrations/client-libraries-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
