papi-ai / anthropic
Anthropic Claude provider for PapiAI
v0.9.1
2026-03-08 18:13 UTC
Requires
- php: ^8.2
- ext-curl: *
- papi-ai/papi-core: ^0.9
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^3.0
- vimeo/psalm: ^6.0
README
Anthropic Claude provider for PapiAI - A simple but powerful PHP library for building AI agents.
Installation
composer require papi-ai/anthropic
Usage
use PapiAI\Core\Agent; use PapiAI\Anthropic\AnthropicProvider; $provider = new AnthropicProvider( apiKey: $_ENV['ANTHROPIC_API_KEY'], ); $agent = new Agent( provider: $provider, model: 'claude-sonnet-4-20250514', instructions: 'You are a helpful assistant.', ); $response = $agent->run('Hello!'); echo $response->text;
Available Models
claude-sonnet-4-20250514(default)claude-3-opus-20240229claude-3-sonnet-20240229claude-3-haiku-20240307
Features
- Tool/function calling
- Vision/multimodal support
- Streaming support
License
MIT