PHPackages                             cheinisch/openrouter-php-client - 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. cheinisch/openrouter-php-client

ActiveLibrary[API Development](/categories/api)

cheinisch/openrouter-php-client
===============================

Modern, lightweight PHP client for the OpenRouter.ai API. Provides a simple interface for chat completions, text generation, and custom LLM endpoints.

v0.3(2mo ago)21.3k↑203.1%1MITPHPPHP &gt;=8.1

Since Sep 4Pushed 2mo agoCompare

[ Source](https://github.com/cheinisch/OpenRouter-php-Client)[ Packagist](https://packagist.org/packages/cheinisch/openrouter-php-client)[ GitHub Sponsors](https://github.com/sponsors/cheinisch)[ RSS](/packages/cheinisch-openrouter-php-client/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (4)Versions (11)Used By (0)

OpenRouter PHP Client
=====================

[](#openrouter-php-client)

A lightweight PHP client for the [OpenRouter.ai](https://openrouter.ai) API.
Supports simple single-line calls as well as advanced features like tool calling, structured outputs, SSE streaming, plugins, provider routing, and reasoning models.

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

[](#requirements)

- PHP &gt;= 8.1
- Composer
- `guzzlehttp/guzzle` (installed automatically)

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

[](#installation)

```
composer require cheinisch/openrouter-php-client
```

Usage
-----

[](#usage)

### 1) Static convenience method (minimal)

[](#1-static-convenience-method-minimal)

```
