Official Xiaomi provider for the PHP AI SDK. Uses Xiaomi MiMo's OpenAI-compatible API.
composer require aisdk/xiaomiuse AiSdk\Generate;
use AiSdk\Xiaomi;
Xiaomi::create(['apiKey' => $_ENV['XIAOMI_API_KEY']]);
$result = Generate::text('Explain this code briefly.')
->model(Xiaomi::model('mimo-v2.5'))
->run();| Variable | Description | Default |
|---|---|---|
XIAOMI_API_KEY |
API key for authentication | Required |
XIAOMI_BASE_URL |
Base URL for API requests | https://api.xiaomimimo.com/v1 |
Xiaomi::create([
'apiKey' => $_ENV['XIAOMI_API_KEY'],
'baseUrl' => 'https://api.xiaomimimo.com/v1',
]);| Capability | Support |
|---|---|
| Text generation and streaming | Native OpenAI-compatible chat |
| Tool calling, structured output, reasoning | Passed through for supported models |
| Image input | Passed through for compatible vision models |
Use providerOptions('xiaomi', ['raw' => [...]]) for documented MiMo chat-completions fields outside the portable SDK surface. Model IDs are opaque strings and are validated by Xiaomi.