PHPackages                             omarsabbagh/php-openai-structured - 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. omarsabbagh/php-openai-structured

ActiveLibrary

omarsabbagh/php-openai-structured
=================================

A PHP package for easily working with OpenAI's structured output feature

0.2(1y ago)0339↓100%MITPHPPHP ^8.1CI passing

Since Mar 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alsabagh-innos-1/php-openai-structured)[ Packagist](https://packagist.org/packages/omarsabbagh/php-openai-structured)[ RSS](/packages/omarsabbagh-php-openai-structured/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

PHP OpenAI Structured Output
============================

[](#php-openai-structured-output)

[![PHP Composer](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/php.yml/badge.svg)](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/php.yml)[![Coding Standards](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/coding-standards.yml)[![Static Analysis](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/static-analysis.yml)[![PHP Compatibility](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/php-compatibility.yml/badge.svg)](https://github.com/omarsabbagh/php-openai-structured/actions/workflows/php-compatibility.yml)[![codecov](https://camo.githubusercontent.com/de39560435564140546b1849b454d146e365fdf8e04f596020a992165a897da1/68747470733a2f2f636f6465636f762e696f2f67682f6f6d6172736162626167682f7068702d6f70656e61692d737472756374757265642f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/omarsabbagh/php-openai-structured)

A PHP package for easily working with OpenAI's structured output feature. This package provides a simple and intuitive way to define JSON schemas for OpenAI API calls and process the structured responses.

Features
--------

[](#features)

- Simple client for making OpenAI API calls with structured output
- Fluent interface for building JSON schemas
- Pre-built schema types for common use cases
- Type-safe PHP classes with proper documentation

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

[](#installation)

Install via Composer:

```
composer require omarsabbagh/php-openai-structured
```

Basic Usage
-----------

[](#basic-usage)

```
