adachsoft / ai-model-list-provider-moonshot
Moonshot provider allowing autodiscovery registration for AdachSoft AI Model List SPI
Package info
gitlab.com/a.adach/ai-model-list-provider-moonshot
pkg:composer/adachsoft/ai-model-list-provider-moonshot
v0.1.0
2026-03-27 08:12 UTC
Requires
- php: ^8.3
- adachsoft/ai-model-list: ^0.4
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
- adachsoft/ai-model-list-plugin: ^0.4
- adachsoft/php-code-style: ^0.4
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- rector/rector: ^2.3
- vlucas/phpdotenv: ^5.6
This package is not auto-updated.
Last update: 2026-03-28 06:42:28 UTC
README
Moonshot provider for adachsoft/ai-model-list with autodiscovery support.
Installation
composer require adachsoft/ai-model-list-provider-moonshot
Configuration
Provide your API key through one of these configuration keys:
moonshot_api_keyapi_key
Optional base URL keys:
moonshot_base_urlbase_url
For environment-based setups you can expose values such as:
MOONSHOT_API_KEY=your-api-key
MOONSHOT_BASE_URL=https://api.moonshot.ai/v1
Usage
Direct usage
<?php
declare(strict_types=1);
use AdachSoft\AIModelList\Spi\AiModelProvider\Model\ProviderId;
use AdachSoft\AiModelListProviderMoonshot\MoonshotProvider;
$provider = new MoonshotProvider(
apiKey: $_ENV['MOONSHOT_API_KEY'],
);
$models = $provider->listModels(new ProviderId('moonshot'));
foreach ($models as $model) {
echo $model->modelId->value . PHP_EOL;
}
Autodiscovery
This package exposes resources/ai-model-list.php for adachsoft/ai-model-list-plugin, so the provider factory can be discovered automatically.
License
MIT