PHPackages                             eatzy/openrouter-php-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. eatzy/openrouter-php-sdk

ActiveLibrary[API Development](/categories/api)

eatzy/openrouter-php-sdk
========================

Production-ready framework-agnostic PHP SDK for OpenRouter API with Laravel integration

1.0.3(2mo ago)06↓50%MITPHPPHP ^8.1

Since Feb 12Pushed 2mo agoCompare

[ Source](https://github.com/eatzy-software/eatzy-openrouter-sdk)[ Packagist](https://packagist.org/packages/eatzy/openrouter-php-sdk)[ RSS](/packages/eatzy-openrouter-php-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (8)Versions (4)Used By (0)

OpenRouter PHP SDK
==================

[](#openrouter-php-sdk)

Production-ready, framework-agnostic PHP SDK for OpenRouter API with Laravel integration.

Features
--------

[](#features)

- ✅ **Framework-agnostic core** - Works with any PHP 8.1+ application
- ✅ **Laravel integration** - Seamless Laravel 9+ integration with Service Provider and Facade
- ✅ **Full OpenRouter API support** - Chat completions, streaming, embeddings, models
- ✅ **Robust error handling** - Comprehensive exception hierarchy with detailed error information
- ✅ **Production-ready** - Retry logic, timeout handling, and middleware support
- ✅ **Type-safe** - Strict typing with comprehensive validation
- ✅ **Lightweight** - Minimal dependencies, only Guzzle HTTP client required

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

[](#installation)

```
composer require eatzy/openrouter-php-sdk
```

Quick Start
-----------

[](#quick-start)

### Vanilla PHP Usage

[](#vanilla-php-usage)

```
