Skip to content

l4nos/anthropic-php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Anthropic PHP Client

A PHP client for the Anthropic API.

Installation

composer require lanos/anthropic

Usage

use Lanos\Anthropic\Anthropic;

$anthropic = new Anthropic('your-api-key');

// Create a message
$response = $anthropic->messages()->create([
    'model' => 'claude-3-opus-20240229',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello, Claude!']
    ],
    'max_tokens' => 1024
]);

// List available models
$models = $anthropic->models()->list();

// Create a message batch
$batch = $anthropic->messageBatches()->create([
    'model' => 'claude-3-opus-20240229',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello!'],
        ['role' => 'user', 'content' => 'How are you?']
    ]
]);

About

A PHP client for the Anthropic API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages