Download the PHP package eatzy/openrouter-php-sdk without Composer
On this page you can find all versions of the php package eatzy/openrouter-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package openrouter-php-sdk
OpenRouter PHP SDK
Production-ready, framework-agnostic PHP SDK for OpenRouter API with Laravel integration.
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
Quick Start
Vanilla PHP Usage
Laravel Usage
1. Publish Configuration
2. Configure Environment Variables
3. Use the Facade
Configuration
Vanilla PHP Configuration
Laravel Configuration
Publish the config file and modify config/openrouter.php:
Advanced Features
Structured Outputs
Multi-modal Content
Retry Logic
The SDK includes built-in retry logic with exponential backoff:
Error Handling
Testing
Run the test suite:
Requirements
- PHP 8.1+
- Guzzle HTTP Client 7.8+
- JSON extension
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
Support
For support, please open an issue on GitHub or contact the maintainers.
All versions of openrouter-php-sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.8
psr/http-message Version ^1.1|^2.0
ext-json Version *
guzzlehttp/guzzle Version ^7.8
psr/http-message Version ^1.1|^2.0
The package eatzy/openrouter-php-sdk contains the following files
Loading the files please wait ...