PHPackages                             ceytek-labs/openai - 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. ceytek-labs/openai

ActiveLibrary[API Development](/categories/api)

ceytek-labs/openai
==================

A lightweight library for seamless integration with the OpenAI API in PHP.

v0.6.5(1y ago)16MITPHPPHP ^8.1

Since Oct 22Pushed 1y agoCompare

[ Source](https://github.com/ceytek-labs/openai)[ Packagist](https://packagist.org/packages/ceytek-labs/openai)[ Docs](https://github.com/ceytek-labs/openai)[ RSS](/packages/ceytek-labs-openai/feed)WikiDiscussions 0.x Synced 1mo ago

READMEChangelogDependenciesVersions (22)Used By (0)

 [![OpenAI - ChatGPT API Library](https://raw.githubusercontent.com/ceytek-labs/openai/refs/heads/0.x/art/banner.png)](https://raw.githubusercontent.com/ceytek-labs/openai/refs/heads/0.x/art/banner.png)

 [![Total Downloads](https://camo.githubusercontent.com/fd02c05a9ac3eff74e0db641b6ab1cb096c23b7b733a60d5ead36e9ebe63608c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63657974656b2d6c6162732f6f70656e6169)](https://packagist.org/packages/ceytek-labs/openai) [![Latest Version](https://camo.githubusercontent.com/25c2b28aed19396af730f9c14f2882b6b305efb6eaeb7f76dff070175bf87bf8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63657974656b2d6c6162732f6f70656e6169)](https://packagist.org/packages/ceytek-labs/openai) [![Size](https://camo.githubusercontent.com/5938747846c5577e5ddbd9aca36cc506211773f6b3464ea43a99093bd4957fa5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f63657974656b2d6c6162732f6f70656e6169)](https://packagist.org/packages/ceytek-labs/openai) [![License](https://camo.githubusercontent.com/8db0d2a310ecfb8cec0930511132650af78d7c52007c337a8453fbef6082e672/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63657974656b2d6c6162732f6f70656e6169)](https://packagist.org/packages/ceytek-labs/openai)

---

OpenAI - ChatGPT API Library
============================

[](#openai---chatgpt-api-library)

**OpenAI - ChatGPT API Library** is a lightweight and extensible library designed to simplify your interaction with OpenAI APIs in PHP. With this library, you can create speech, transcriptions, chat completions, and more.

> **Disclaimer:** This package is not an official product of OpenAI. The developers accept no responsibility for any issues, discrepancies, or damages that may arise from its use.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher

Installation
------------

[](#installation)

You can add this package to your project via Composer:

```
composer require ceytek-labs/openai
```

Services
--------

[](#services)

- [Audio Processing](#audio-processing)
    - [Create Speech](#audio-processing-create-speech)
    - [Create Transcription](#audio-processing-create-transcription)
- [Chat Completion](#chat-completion)
    - [Text Completion](#chat-completion-text-completion)
    - [Image Recognition](#chat-completion-image-recognition)
- [Model Management](#model-management)
    - [Available Models List](#model-management-available-models-list)
    - [Retrieve Model Information](#model-management-retrieve-model-information)

Audio Processing
----------------

[](#audio-processing)

This function provides easy integration with OpenAI’s TTS and transcription services.

### Example Usage

[](#example-usage)

The following example demonstrates how to update data in a **Audio Processing** document:

**[⬆ Back to services](#services)**

#### Audio Processing: Create Speech

[](#audio-processing-create-speech)

This feature allows you to convert text to speech using a specified TTS model and voice.

```
use CeytekLabs\OpenAI\OpenAI;
use CeytekLabs\OpenAI\Enums\TTSModel;
use CeytekLabs\OpenAI\Enums\Voice;

try {
    $openai = OpenAI::make('')
        ->audio()
        ->createSpeech()
        ->setModel(TTSModel::TTS_1)
        ->setInput('The quick brown fox jumped over the lazy dog.')
        ->setVoice(Voice::Shimmer)
        ->ask();

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

**[⬆ Back to services](#services)**

#### Audio Processing: Create Transcription

[](#audio-processing-create-transcription)

This function transcribes audio files into text, accepting various audio formats.

```
use CeytekLabs\OpenAI\OpenAI;

try {
    $openai = OpenAI::make('')
        ->audio()
        ->createTranscription()
        ->setFile(__DIR__.'/speeches/speech1.mp3')
        ->ask();

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

**[⬆ Back to services](#services)**

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

[](#chat-completion)

Chat completion features provide flexible options for text and image-based conversations.

### Example Usage

[](#example-usage-1)

The following example demonstrates how to update data in a **Chat Completion** document:

**[⬆ Back to services](#services)**

#### Chat Completion: Text Completion

[](#chat-completion-text-completion)

Generates a text-based response based on a given prompt.

```
use CeytekLabs\OpenAI\OpenAI;
use CeytekLabs\OpenAI\Enums\Model;

try {
    $openai = OpenAI::make('')
        ->chat()
        ->createCompletion()
        ->setModel(Model::GPT_3_5_TURBO_0125)
        ->setPrompt('give your answer as json and keep it simple')
        ->ask('What is your name');

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

**[⬆ Back to services](#services)**

#### Chat Completion: Image Recognition

[](#chat-completion-image-recognition)

This feature enables the library to analyze and interpret images.

```
use CeytekLabs\OpenAI\OpenAI;
use CeytekLabs\OpenAI\Enums\Model;

try {
    $openai = OpenAI::make('')
        ->chat()
        ->createImageCompletion()
        ->setModel(Model::GPT_4_TURBO)
        ->ask('What is in this image', 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg');

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

**[⬆ Back to services](#services)**

Model Management
----------------

[](#model-management)

Easily manage models to get information about available or specific models.

### Example Usage

[](#example-usage-2)

The following example demonstrates how to update data in a **Model Management** document:

**[⬆ Back to services](#services)**

#### Model Management: Available Models List

[](#model-management-available-models-list)

Retrieve a list of all available models.

```
use CeytekLabs\OpenAI\OpenAI;

try {
    $openai = OpenAI::make('')
        ->model()
        ->availableList()
        ->ask();

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

**[⬆ Back to services](#services)**

#### Model Management: Retrieve Model Information

[](#model-management-retrieve-model-information)

Get details about a specific model.

```
use CeytekLabs\OpenAI\OpenAI;
use CeytekLabs\OpenAI\Enums\Model;

try {
    $openai = OpenAI::make('')
        ->model()
        ->retrieve()
        ->ask(Model::GPT_4O_MINI);

    print_r($openai->getResponse());
} catch (\Exception $exception) {
    echo $exception->getMessage();
}
```

Contributing
------------

[](#contributing)

Feel free to submit a **pull request** or report an issue. Any contributions and feedback are highly appreciated!

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

21

Last Release

543d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd04f7a68c28475cb5493f3d841a7ae95ad200188efb658e1a37e30a5f2ba6db?d=identicon)[ceyhun-celik](/maintainers/ceyhun-celik)

---

Top Contributors

[![ceyhun-celik](https://avatars.githubusercontent.com/u/112348956?v=4)](https://github.com/ceyhun-celik "ceyhun-celik (20 commits)")

---

Tags

aiapichatgptimage-recognitionlite-libraryopenaitext-to-speechtranscriptionphpapiaiopenaiChatGptTranscriptiontext-to-speechimage recognitionlite library

### Embed Badge

![Health badge](/badges/ceytek-labs-openai/health.svg)

```
[![Health](https://phpackages.com/badges/ceytek-labs-openai/health.svg)](https://phpackages.com/packages/ceytek-labs-openai)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5010.8k](/packages/claude-php-claude-php-sdk-laravel)

PHPackages © 2026

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