PHPackages                             aisdk/moonshot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aisdk/moonshot

ActiveLibrary

aisdk/moonshot
==============

Official Moonshot provider for the PHP AI SDK.

v0.8.0(1mo ago)01MITPHPPHP ^8.3CI passing

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/phpaisdk/moonshot)[ Packagist](https://packagist.org/packages/aisdk/moonshot)[ Docs](https://github.com/phpaisdk/moonshot)[ RSS](/packages/aisdk-moonshot/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

aisdk/moonshot
==============

[](#aisdkmoonshot)

[![GitHub Workflow Status](https://camo.githubusercontent.com/91e6e06391dd81769feb3a599023fe46bb98d7e939c2e604fcdddf1b6d9351f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870616973646b2f6d6f6f6e73686f742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://github.com/phpaisdk/moonshot/actions)[![Total Downloads](https://camo.githubusercontent.com/316b9db3026b77f3232a255bd767daa0bed7fb3989a6b9cac7beb6f4c2d3252d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616973646b2f6d6f6f6e73686f74)](https://packagist.org/packages/aisdk/moonshot)[![Latest Version](https://camo.githubusercontent.com/b6b045f657f9670409ceda8aa2ce0ebb58f0896f6142af788c455e35ebe6fe4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616973646b2f6d6f6f6e73686f74)](https://packagist.org/packages/aisdk/moonshot)[![License](https://camo.githubusercontent.com/6ecc044c762b836a49eeb39cd1af60d803b036e81f66114035f2d05e293a506f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616973646b2f6d6f6f6e73686f74)](https://packagist.org/packages/aisdk/moonshot)[![Why PHP in 2026](https://camo.githubusercontent.com/d2b9305e630caf7daae4ca023de39ece0b885c37461629d42961533f00868b76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5768795f5048502d696e5f323032362d3741383645383f7374796c653d666c61742d737175617265266c6162656c436f6c6f723d313831383162)](https://whyphp.dev)

---

Official Moonshot provider for the PHP AI SDK. Uses Moonshot's Chat Completions API.

Installation
------------

[](#installation)

```
composer require aisdk/moonshot
```

Basic Usage
-----------

[](#basic-usage)

```
use AiSdk\Generate;
use AiSdk\Moonshot;

$result = Generate::text('What happened in technology today?')
    ->model(Moonshot::model('kimi-k2.7-code'))
    ->run();

echo $result->text;
```

Configuration
-------------

[](#configuration)

VariableDescriptionDefault`MOONSHOT_API_KEY`API key for authenticationRequired`MOONSHOT_BASE_URL`Base URL for API requests`https://api.moonshot.ai`Supported Capabilities
----------------------

[](#supported-capabilities)

CapabilitySupportText generationNativeStreamingNativeTool callingNativeStructured outputAdapted (`json_object` with an explicit JSON instruction)Text inputNativeProvider-specific fields can be passed through `providerOptions('moonshot', [...])`. Model IDs are opaque strings and Moonshot remains the authority on model availability.

Testing
-------

[](#testing)

```
composer test:all
```

Documentation
-------------

[](#documentation)

- [PHP AI SDK documentation](https://phpaisdk.com/docs)
- [Moonshot AI documentation](https://phpaisdk.com/docs/moonshot)

Community
---------

[](#community)

- [Contributing](https://github.com/phpaisdk/.github/blob/main/CONTRIBUTING.md)
- [Support](https://github.com/phpaisdk/.github/blob/main/SUPPORT.md)
- For private security reports, email .

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef29d1962da41e7526023f215cf844494e209b2fd163742084cb919a3b508021?d=identicon)[aisdk](/maintainers/aisdk)

---

Top Contributors

[![RanaMoizHaider](https://avatars.githubusercontent.com/u/58527494?v=4)](https://github.com/RanaMoizHaider "RanaMoizHaider (3 commits)")

---

Tags

aillmmoonshotopenai-compatibleaisdk

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aisdk-moonshot/health.svg)

```
[![Health](https://phpackages.com/badges/aisdk-moonshot/health.svg)](https://phpackages.com/packages/aisdk-moonshot)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
