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

ActiveLibrary

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.2.2(7mo ago)1371↓25%1MITPHPPHP &gt;=8.1

Since Sep 4Pushed 7mo 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 1mo ago

READMEChangelog (10)Dependencies (2)Versions (10)Used By (0)

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

[](#openrouter-php-client)

It’s a lightweight PHP client for the OpenRouter.ai API that lets you call chat models with a single static method or a simple client, returning the plain text answer. It supports optional attribution headers (Referer/Title), works with many models (e.g., GPT-4o-mini, Claude 3.5, Gemini 2.5, Mistral), and installs via Composer.

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

[](#requirements)

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

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

[](#installation)

`composer require cheinisch/openrouter-php-client`

Usage
-----

[](#usage)

1. Minimal (static convenience method)

```
