PHPackages                             marlemiesz/gpt-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. [API Development](/categories/api)
4. /
5. marlemiesz/gpt-sdk

ActiveLibrary[API Development](/categories/api)

marlemiesz/gpt-sdk
==================

Effortlessly integrate with OpenAI GPT using our PHP library. User-friendly functions and classes simplify complex tasks. Ideal for PHP developers of all levels. Streamline integration with OpenAI GPT.

0.2(2y ago)1251PHPPHP ^8.2

Since Feb 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/marlemiesz/gpt-sdk)[ Packagist](https://packagist.org/packages/marlemiesz/gpt-sdk)[ RSS](/packages/marlemiesz-gpt-sdk/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
"marlemiesz/gpt-sdk": "^0.2"
```

OR

```
composer require marlemiesz/gpt-sdk: 0.2
```

Docs
====

[](#docs)

Authentication
--------------

[](#authentication)

To use the SDK, you need to create an instance of the `OpenAi` class and pass it your api key.

```
use Marlemiesz\GptSdk\OpenAi;
$openai = new OpenAi('api-key');
```

Completion
----------

[](#completion)

Api Reference:

### Create completion

[](#create-completion)

```
$response = $openai->generateText(
            model: GptModelEnum::Davinci,
            prompt: 'Prompt text',
            maxTokens: 16,
            temperature: 1,
        );
```

Chat Completion
---------------

[](#chat-completion)

Api Reference:

### Create chat completion

[](#create-chat-completion)

```
$response = $openai->generateChatText(
            model: GptChatModelEnum::GPT35Turbo,
            role: 'user',
            content: 'Prompt text',
            maxTokens: 160,
        );
```

Image
-----

[](#image)

Api Reference:

### Create image

[](#create-image)

```
$response = $openai->generateImage(
            'Prompt text',
            1,
            ImageSizeEnum::large
        );
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~277 days

Total

2

Last Release

964d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/882e5c9cdc30b052d3c2d2f225d52e2341246fd0bd603cfb0d0b9c5bd0d784b0?d=identicon)[mlemiesz](/maintainers/mlemiesz)

---

Top Contributors

[![marlemiesz](https://avatars.githubusercontent.com/u/4789303?v=4)](https://github.com/marlemiesz "marlemiesz (19 commits)")[![patrykkalinowski99](https://avatars.githubusercontent.com/u/80587030?v=4)](https://github.com/patrykkalinowski99 "patrykkalinowski99 (2 commits)")[![bartoszborowik](https://avatars.githubusercontent.com/u/143994235?v=4)](https://github.com/bartoszborowik "bartoszborowik (1 commits)")

---

Tags

sdkGPT-3openaigpt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marlemiesz-gpt-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/marlemiesz-gpt-sdk/health.svg)](https://phpackages.com/packages/marlemiesz-gpt-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[jdcloud-api/jdcloud-sdk-php

JDCloud SDK for PHP

105.2k](/packages/jdcloud-api-jdcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
