PHPackages                             gemina/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. gemina/sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gemina/sdk
==========

Official PHP client for the Gemina API — invoice OCR and document intelligence: upload documents, get typed structured data back, then search, aggregate, and chat over everything you've processed.

v0.5.4(1w ago)05MITPHPPHP ^8.1

Since Jul 4Pushed 1w agoCompare

[ Source](https://github.com/tommyil/gemina-sdk-php)[ Packagist](https://packagist.org/packages/gemina/sdk)[ Docs](https://gemina.co)[ RSS](/packages/gemina-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (9)Versions (16)Used By (0)

Gemina PHP SDK
==============

[](#gemina-php-sdk)

Official PHP client for the Gemina API — invoice OCR and document intelligence: upload documents, get typed structured data back, then search, aggregate, and chat over everything you've processed.

Install
-------

[](#install)

```
composer require gemina/sdk
```

Requires PHP 8.1+ with the `curl`, `json`, and `mbstring` extensions.

Authenticate
------------

[](#authenticate)

Get your API key from the [Gemina Console](https://console.gemina.co). The client sends it as the `X-API-Key` header on every request:

```
use Gemina\Sdk\GeminaClient;

$client = new GeminaClient('YOUR_API_KEY');
```

Never ship the API key in browser or mobile code. For browser embedding, mint short-lived session tokens server-side (`POST /v1/sessions/token`) — see [Session tokens](#session-tokens-browser-embedding) below and the Document Intelligence guide at [console.gemina.co/docs](https://console.gemina.co/docs).

Quickstart — process an invoice in one call
-------------------------------------------

[](#quickstart--process-an-invoice-in-one-call)

`processDocument()` submits the file through the async API, polls with exponential backoff until processing finishes, and returns the final typed result:

```
