PHPackages                             vityakut/proxyapi - 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. vityakut/proxyapi

ActiveLibrary[API Development](/categories/api)

vityakut/proxyapi
=================

Proxy Api PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

0.1.0(1y ago)1161MITPHPPHP ^8.1.0

Since May 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vityakut/proxyapi)[ Packagist](https://packagist.org/packages/vityakut/proxyapi)[ RSS](/packages/vityakut-proxyapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

 [![GitHub Workflow Status (master)](https://camo.githubusercontent.com/de7ab73922bfaef398f46ac8faad418e9a6de89e359b3d7a541bf272182eceda/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76697479616b75742f70726f78796170692f74657374732e796d6c3f6272616e63683d6d6173746572)](https://github.com/vityakut/proxyapi/actions) [![Total Downloads](https://camo.githubusercontent.com/dd5e93f547eab9042fecbae1ce1f72ae40586dcd137b16f2ecb838ce1659ea1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76697479616b75742f70726f7879617069)](https://packagist.org/packages/vityakut/proxyapi) [![Latest Version](https://camo.githubusercontent.com/5bb7a7b2c3ebbb729f6b5e72a8325a071b2cd29c4eca7634ddb8967793694a0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76697479616b75742f70726f7879617069)](https://packagist.org/packages/vityakut/proxyapi) [![GitHub Release](https://camo.githubusercontent.com/2fc87e32cd8c72f8118592a73f942ce617e58b0e454faefc0d0b14c3fe8df0cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f76697479616b75742f70726f7879617069)](https://github.com/vityakut/proxyapi/releases/latest) [![License](https://camo.githubusercontent.com/6a3f47081511c6f69b9488594b35463d949c77ac84a086c424d4703b254b72fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f76697479616b75742f70726f7879617069)](https://packagist.org/packages/vityakut/proxyapi)

---

**Proxy Api PHP** for Laravel is a community-maintained PHP API client that allows you to interact with the [Open AI Proxy API](https://proxyapi.ru/docs). If you or your business relies on this package, it's important to support the developers who have contributed their time and effort to create and maintain this valuable tool:

> **Note:** This repository contains the integration code of the **OpenAI PHP** for Laravel. If you want to use the **OpenAI PHP** client in a framework-agnostic way, take a look at the [openai-php/client](https://github.com/openai-php/client) repository.

Get Started
-----------

[](#get-started)

> **Requires [PHP 8.1+](https://php.net/releases/)**

First, install OpenAI via the [Composer](https://getcomposer.org/) package manager:

```
composer require vityakut/proxyapi
```

Next, execute the install command:

```
php artisan proxyapi:install
```

This will create a `config/proxyapi.php` configuration file in your project, which you can modify to your needs using environment variables. Blank environment variables for the Proxy API key are already appended to your `.env` file.

```
PROXYAPI_API_KEY=sk-...
```

Finally, you may use the `ProxyApi` facade to access the OpenAI API:

```
use vityakut\ProxyApi\Facades\ProxyApi;

$result = ProxyApi::chat()->create([
    'model' => 'gpt-3.5-turbo',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello!'],
    ],
]);

echo $result->choices[0]->message->content; // Hello! How can I assist you today?

```

Configuration
-------------

[](#configuration)

Configuration is done via environment variables or directly in the configuration file (`config/proxyapi.php`).

### ProxyAPI Key

[](#proxyapi-key)

Specify your Proxy API Key. This will be used to authenticate with the Proxy API - you can find your API key on your OpenAI dashboard, at .

```
PROXYAPI_API_KEY=
```

### Request Timeout

[](#request-timeout)

The timeout may be used to specify the maximum number of seconds to wait for a response. By default, the client will time out after 30 seconds.

```
PROXYAPI_REQUEST_TIMEOUT=
```

Usage
-----

[](#usage)

For usage examples, take a look at the [openai-php/client](https://github.com/openai-php/client) repository.

Testing
-------

[](#testing)

The `OpenAI` facade comes with a `fake()` method that allows you to fake the API responses.

The fake responses are returned in the order they are provided to the `fake()` method.

All responses are having a `fake()` method that allows you to easily create a response object by only providing the parameters relevant for your test case.

```
use OpenAI\Laravel\Facades\OpenAI;
use OpenAI\Responses\Completions\CreateResponse;

ProxyApi::fake([
    CreateResponse::fake([
        'choices' => [
            [
                'text' => 'awesome!',
            ],
        ],
    ]),
]);

$completion = ProxyApi::completions()->create([
    'model' => 'gpt-3.5-turbo-instruct',
    'prompt' => 'PHP is ',
]);

expect($completion['choices'][0]['text'])->toBe('awesome!');
```

After the requests have been sent there are various methods to ensure that the expected requests were sent:

```
// assert completion create request was sent
ProxyApi::assertSent(Completions::class, function (string $method, array $parameters): bool {
    return $method === 'create' &&
        $parameters['model'] === 'gpt-3.5-turbo-instruct' &&
        $parameters['prompt'] === 'PHP is ';
});
```

For more testing examples, take a look at the [openai-php/client](https://github.com/openai-php/client#testing) repository.

---

ProxyApi PHP for Laravel is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

722d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b715bb2772d45e00bb693582b6f2fe42245a1ade0cbc38f176460d2a128e2164?d=identicon)[vityakut](/maintainers/vityakut)

---

Top Contributors

[![vityakut](https://avatars.githubusercontent.com/u/6539454?v=4)](https://github.com/vityakut "vityakut (14 commits)")

---

Tags

phpapiclientlaravelsdklanguageprocessingnaturalcodexGPT-3openaidall-eproxyapi

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vityakut-proxyapi/health.svg)

```
[![Health](https://phpackages.com/badges/vityakut-proxyapi/health.svg)](https://phpackages.com/packages/vityakut-proxyapi)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[openai-php/symfony

Symfony Bundle for OpenAI

215715.5k3](/packages/openai-php-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
