adachsoft/ai-model-list-provider-moonshot

Moonshot provider allowing autodiscovery registration for AdachSoft AI Model List SPI

Maintainers

Package info

gitlab.com/a.adach/ai-model-list-provider-moonshot

Issues

pkg:composer/adachsoft/ai-model-list-provider-moonshot

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-03-27 08:12 UTC

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_key
  • api_key

Optional base URL keys:

  • moonshot_base_url
  • base_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