adachsoft / ai-model-list-provider-anthropic
Anthropic (Claude) provider for AdachSoft AI Model List (SPI)
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/adachsoft/ai-model-list-provider-anthropic
Requires
- php: >=8.3
- adachsoft/ai-model-list: *
- adachsoft/collection: >=2.1
- adachsoft/console-io: ^0.1.0
- guzzlehttp/guzzle: >=7.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^1.11
- phpunit/phpunit: >=12.0
This package is not auto-updated.
Last update: 2025-10-18 02:45:05 UTC
README
Anthropic (Claude) provider for AdachSoft AI Model List (SPI).
Requirements
- PHP >= 8.3
- adachsoft/ai-model-list
- adachsoft/collection >= 2.1
- guzzlehttp/guzzle >= 7.8
Installation (local path repository)
{
"repositories": [
{ "type": "path", "url": "../ai-model-list-provider-anthropic", "options": { "symlink": true } }
],
"require": {
"adachsoft/ai-model-list-provider-anthropic": "*"
}
}
In this library composer.json:
{
"name": "adachsoft/ai-model-list-provider-anthropic",
"autoload": { "psr-4": { "AdachSoft\\AIModelListProviderAnthropic\\": "src/" } }
}
Quick Start
use AdachSoft\AIModelList\PublicApi\Builder\AiModelCatalogFacadeBuilder;
use AdachSoft\AIModelListProviderAnthropic\AnthropicSpiProvider;
use AdachSoft\AIModelListProviderAnthropic\Config\AnthropicProviderConfig;
use AdachSoft\AIModelListProviderAnthropic\Http\GuzzleAnthropicHttpClient;
use AdachSoft\AIModelListProviderAnthropic\Mapper\AnthropicToSpiModelMapper;
use AdachSoft\AIModelList\Spi\AiModelProvider\Model\ProviderId as SpiProviderId;
$config = new AnthropicProviderConfig($apiKey, 'https://api.anthropic.com', '2023-06-01', 10.0);
$http = new GuzzleAnthropicHttpClient($config);
$mapper = new AnthropicToSpiModelMapper();
$provider = new AnthropicSpiProvider($http, $mapper);
$facade = (new AiModelCatalogFacadeBuilder())->withSpiProvider($provider)->build();
$facade->listModels(new SpiProviderId('anthropic'));
CLI
- Ensure ANTHROPIC_API_KEY env variable is set.
- Optional env: ANTHROPIC_BASE_URL (default https://api.anthropic.com), ANTHROPIC_API_VERSION (default 2023-06-01), ANTHROPIC_TIMEOUT (default 10).
Run:
php bin/anthropic-list-models