PHPackages                             adaiasmagdiel/meta-ai-api - 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. adaiasmagdiel/meta-ai-api

ActiveLibrary[API Development](/categories/api)

adaiasmagdiel/meta-ai-api
=========================

Llama 3 API 70B &amp; 405B (MetaAI Reverse Engineered) in PHP, based on the work of \[Strvm\](https://github.com/Strvm/meta-ai-api/)

v1.1.0(1y ago)33272[1 issues](https://github.com/AdaiasMagdiel/meta-ai-api/issues)GPL-3.0-onlyPHP

Since Nov 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AdaiasMagdiel/meta-ai-api)[ Packagist](https://packagist.org/packages/adaiasmagdiel/meta-ai-api)[ RSS](/packages/adaiasmagdiel-meta-ai-api/feed)WikiDiscussions main Synced today

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

PHP MetaAI API Wrapper
======================

[](#php-metaai-api-wrapper)

MetaAI is a PHP library designed to seamlessly interact with Meta's AI APIs, which power the backend of [meta.ai](https://www.meta.ai/). This library simplifies the complexities of authentication and communication, offering a user-friendly interface for sending queries and receiving responses from Meta AI.

This project is inspired by and builds upon the excellent work of [Strvm](https://github.com/Strvm/meta-ai-api/), originally implemented in Python.

With **MetaAI**, you can effortlessly prompt the AI with a message and receive real-time responses directly in your PHP applications.

**No API key is required.**

Key Features:

- **Internet-connected AI**: MetaAI leverages real-time capabilities (powered by Bing), enabling you to receive up-to-date responses.
- **Powered by Llama 3 LLM**: Utilizes Meta's latest **Llama 3** large language model for high-quality responses.

Important

This project does not yet support image generation.

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

[](#installation)

Install the Meta AI API library using Composer:

```
composer require adaiasmagdiel/meta-ai-api
```

### Getting Started

[](#getting-started)

Basic Usage

```
require_once __DIR__ . "/vendor/autoload.php";

use AdaiasMagdiel\MetaAI\Client;

$client = new Client();
$response = $client->prompt("What's the date and weather in Itaituba, Pará, today?");

echo $response->message . PHP_EOL;
```

### Streaming Responses

[](#streaming-responses)

Enable streaming to receive responses in real-time:

```
require_once __DIR__ . "/vendor/autoload.php";

use AdaiasMagdiel\MetaAI\Client;

$client = new Client();
$response = $client->prompt("Tell me about the latest tech news.", stream: true);

foreach ($response as $chunk) {
    var_dump($chunk);
}
```

### Terminal Stream Viewer

[](#terminal-stream-viewer)

Create a terminal stream viewer to display responses in a formatted way:

Steps:

- Include the autoload file;
- Import the Client class;
- Create a Client instance;
- Send a request with streaming;
- Initialize the line counter;
- Iterate over the response stream;
- Move the cursor to the top;
- Format the message;
- Display the message in the terminal;
- Update the line counter.

```
require_once __DIR__ . "/vendor/autoload.php";

use AdaiasMagdiel\MetaAI\Client;

$client = new Client();

// Send a prompt to the API with streaming enabled
$response = $client->prompt(
    "Who is Bruce Wayne?",
    stream: true
);

// Initialize line counter
$lines = 0;

// Iterate over the response stream
foreach ($response as $chunk) {
    // Move cursor to top of previous lines, if necessary
    $esc = $lines > 0 ? "\x1B[{$lines}F" : "\r";

    // Format message to 75 characters per line
    $message = wordwrap($chunk->message, 75, "\n", true);

    // Display message in terminal
    echo $esc . $message;
    flush(); // Ensure output is displayed immediately

    // Update line counter
    $lines = substr_count($message, "\n");
}
```

License
-------

[](#license)

This project is licensed under the terms of the [GNU General Public License v3](LICENSE).

Copyright
---------

[](#copyright)

```
AdaiasMagdiel/meta-ai-api: A reverse-engineered API wrapper for MetaAI in PHP, based on the work of [Strvm](https://github.com/Strvm/meta-ai-api/)

Copyright (C) 2024 Adaías Magdiel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see .

```

Additional Licensing Information
--------------------------------

[](#additional-licensing-information)

For detailed information about licensing terms specific to Llama 3, please refer to Meta’s official [Llama 3 License](https://www.llama.com/llama3/license/).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Every ~0 days

Total

4

Last Release

593d ago

Major Versions

v0.1.2 → v1.0.02024-11-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22068596?v=4)[Adaías Magdiel](/maintainers/adaiasmagdiel)[@AdaiasMagdiel](https://github.com/AdaiasMagdiel)

---

Top Contributors

[![AdaiasMagdiel](https://avatars.githubusercontent.com/u/22068596?v=4)](https://github.com/AdaiasMagdiel "AdaiasMagdiel (18 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/adaiasmagdiel-meta-ai-api/health.svg)

```
[![Health](https://phpackages.com/badges/adaiasmagdiel-meta-ai-api/health.svg)](https://phpackages.com/packages/adaiasmagdiel-meta-ai-api)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M987](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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