PHPackages                             modelflow-ai/anthropic - 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. modelflow-ai/anthropic

ActiveLibrary[API Development](/categories/api)

modelflow-ai/anthropic
======================

Client for Anthropic AI API.

0.3.0(1y ago)02.4k↓73.7%1MITPHPPHP ^8.2

Since Jul 31Pushed 1mo agoCompare

[ Source](https://github.com/modelflow-ai/anthropic)[ Packagist](https://packagist.org/packages/modelflow-ai/anthropic)[ RSS](/packages/modelflow-ai-anthropic/feed)WikiDiscussions 0.2 Synced yesterday

READMEChangelogDependencies (12)Versions (8)Used By (1)

 [![Anthropic Logo](https://avatars.githubusercontent.com/u/152068817?s=768&v=4)](https://avatars.githubusercontent.com/u/152068817?s=768&v=4)

Modelflow AI
Anthropic

========================

[](#modelflow-aianthropic)

The Anthropic package is a comprehensive API client for the Anthropic AI model. It provides a simple and intuitive interface to interact with the Anthropic AI model, allowing you to create chat conversations.

> **Note**: This is part of the `modelflow-ai` project create issues in the [main repository](https://github.com/modelflow-ai/.github).

> **Note**: This project is heavily under development and any feedback is greatly appreciated.

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

[](#installation)

To install the Anthropic package, you need to have PHP 8.2 or higher and Composer installed on your machine. Then, you can add the package to your project by running the following command:

```
composer require modelflow-ai/anthropic
```

Examples
--------

[](#examples)

Here are some examples of how you can use the Anthropic in your PHP applications. You can find more detailed examples in the [examples directory](examples).

Usage
-----

[](#usage)

### Creating a Client

[](#creating-a-client)

First, you need to create a client. The client is the main entry point to interact with the Anthropic AI model. You can create a client using the `Anthropic` class:

```
use ModelflowAi\Anthropic\Anthropic;

$client = Anthropic::client('your-api-key');
```

### Using the Chat Resource

[](#using-the-chat-resource)

The Chat resource allows you to create chat conversations and get chat completions.

```
use ModelflowAi\Anthropic\Model;

$chat = $client->chat();

// Create a chat conversation
$parameters = [
    'model' => Model::CLAUDE_3_OPUS->value,
    'messages' => [
        [
            'role' => 'system',
            'content' => 'You are a helpful assistant.'
        ],
        [
            'role' => 'user',
            'content' => 'Who won the world series in 2020?'
        ]
    ]
];
$response = $chat->create($parameters);

// The response is an instance of CreateResponse
echo $response->content[0]->text;
```

API Documentation
-----------------

[](#api-documentation)

For more detailed information about the Anthropic API, please refer to the [official API documentation](https://docs.anthropic.com/claude/reference/getting-started-with-the-api).

Open Points
-----------

[](#open-points)

### Streaming Tools

[](#streaming-tools)

Streaming of tools are not yet available in the Anthropic API. As soon as they are available, we will provide a the stream option with the tools.

### Text completions

[](#text-completions)

The Text Completions resource is not yet in this package.

### Embeddings

[](#embeddings)

The Embeddings resource is not yet in the Anthropic API. As soon as it is available, we will provide a resource to generate and manipulate embeddings for your data.

Testing
-------

[](#testing)

To run the tests, use PHPUnit:

```
composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome. Please open an issue or submit a pull request in the main repository at .

License
-------

[](#license)

This project is licensed under the MIT License. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance70

Regular maintenance activity

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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 ~107 days

Recently: every ~136 days

Total

7

Last Release

31d ago

### Community

Maintainers

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

---

Top Contributors

[![wachterjohannes](https://avatars.githubusercontent.com/u/1464615?v=4)](https://github.com/wachterjohannes "wachterjohannes (16 commits)")

---

Tags

apiclientaianthropic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/modelflow-ai-anthropic/health.svg)

```
[![Health](https://phpackages.com/badges/modelflow-ai-anthropic/health.svg)](https://phpackages.com/packages/modelflow-ai-anthropic)
```

###  Alternatives

[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)[mozex/anthropic-php

PHP client for the Anthropic API: messages, streaming, tool use, thinking, web search, code execution, batches, and more.

49552.5k18](/packages/mozex-anthropic-php)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

46688.8k5](/packages/deepseek-php-deepseek-php-client)[gemini-api-php/client

API client for Google's Gemini API

225274.6k5](/packages/gemini-api-php-client)[gemini-api-php/laravel

Gemini API client for Laravel

8917.4k](/packages/gemini-api-php-laravel)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5223.2k](/packages/claude-php-claude-php-sdk-laravel)

PHPackages © 2026

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