PHPackages                             papi-ai/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. papi-ai/openai

ActiveLibrary[API Development](/categories/api)

papi-ai/openai
==============

OpenAI provider for PapiAI

v0.9.1(3mo ago)09MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 3mo agoCompare

[ Source](https://github.com/papi-ai/openai)[ Packagist](https://packagist.org/packages/papi-ai/openai)[ RSS](/packages/papi-ai-openai/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

PapiAI OpenAI Provider
======================

[](#papiai-openai-provider)

[![CI](https://github.com/papi-ai/openai/workflows/CI/badge.svg)](https://github.com/papi-ai/openai/actions?query=workflow%3ACI) [![Latest Version](https://camo.githubusercontent.com/7ae97d40a921c7d055acc9d4365f3903170a6214735583637f62fe19fb32df00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706170692d61692f6f70656e61692e737667)](https://packagist.org/packages/papi-ai/openai) [![Total Downloads](https://camo.githubusercontent.com/f97ef661492aad3ae0db74145bf13b7111db4331e7a9a5e2ac5f16cc87446337/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706170692d61692f6f70656e61692e737667)](https://packagist.org/packages/papi-ai/openai) [![PHP Version](https://camo.githubusercontent.com/b229a47bf036108a7fcf3131606673d66136703212d4ef2a7f56c864d699f1fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706170692d61692f6f70656e61692e737667)](https://packagist.org/packages/papi-ai/openai) [![License](https://camo.githubusercontent.com/43cb83baa44d97f8f08ca0cdbec977437366601bb110bdfc8f087e4eba841ba4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706170692d61692f6f70656e61692e737667)](https://packagist.org/packages/papi-ai/openai)

OpenAI provider for [PapiAI](https://github.com/papi-ai/papi-core) - A simple but powerful PHP library for building AI agents.

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

[](#installation)

```
composer require papi-ai/openai
```

Usage
-----

[](#usage)

```
use PapiAI\Core\Agent;
use PapiAI\OpenAI\OpenAIProvider;

$provider = new OpenAIProvider(
    apiKey: $_ENV['OPENAI_API_KEY'],
    defaultModel: OpenAIProvider::MODEL_GPT_4O,
);

$agent = new Agent(
    provider: $provider,
    model: 'gpt-4o',
    instructions: 'You are a helpful assistant.',
);

$response = $agent->run('Hello!');
echo $response->text;
```

Available Models
----------------

[](#available-models)

```
OpenAIProvider::MODEL_GPT_4O        // 'gpt-4o' (default, multimodal)
OpenAIProvider::MODEL_GPT_4O_MINI   // 'gpt-4o-mini' (fast, cost-effective)
OpenAIProvider::MODEL_GPT_4_TURBO   // 'gpt-4-turbo' (high quality)
OpenAIProvider::MODEL_O1_PREVIEW    // 'o1-preview' (reasoning)
OpenAIProvider::MODEL_O1_MINI       // 'o1-mini' (fast reasoning)
```

Features
--------

[](#features)

- Tool/function calling
- Vision/multimodal support
- Structured output (JSON mode)
- Streaming support

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance80

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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 ~0 days

Total

5

Last Release

107d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/70713?v=4)[md](/maintainers/md)[@md](https://github.com/md)

---

Top Contributors

[![MarcelloDuarte](https://avatars.githubusercontent.com/u/144535?v=4)](https://github.com/MarcelloDuarte "MarcelloDuarte (17 commits)")

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/papi-ai-openai/health.svg)

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

###  Alternatives

[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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