Search by

adachsoft / model-pricing-source-minimax

Arkadiusz Adach

MiniMax image pricing source for ai-pricing-api

Package info

gitlab.com/a.adach/model-pricing-source-minimax

Issues

pkg:composer/adachsoft/model-pricing-source-minimax

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-12-02 20:28 UTC

This package is auto-updated.

Last update: 2026-12-02 19:29:17 UTC


README

adachsoft/model-pricing-source-minimax provides MiniMax image-model price sheets for the model-pricing synchronization flow. It reads the official Markdown pricing page through PSR-18 and currently supports the Image Generation token table and legacy per-image prices.

Features

  • Fetches MiniMax's official Markdown pricing page using PSR-18 and PSR-17 contracts.
  • Parses Image Generation token pricing and legacy per-image pricing into validated price sheets.
  • Follows a limited number of HTTPS redirects and reports skipped rows as warnings rather than guessing prices.

Installation

composer require adachsoft/model-pricing-source-minimax

Requirements

  • PHP 8.3 or newer.
  • A PSR-18 HTTP client and a PSR-17 request factory supplied by the application.

Usage with ai-pricing-api

Create the source with the application's PSR-18 HTTP client and a PSR-17 request factory, then register it with the PriceSyncService used by ai-pricing-api:

use AdachSoft\ModelPricingSourceMinimax\Http\MinimaxPricingPageFetcher;
use AdachSoft\ModelPricingSourceMinimax\MinimaxPriceSource;

$minimaxSource = new MinimaxPriceSource(
    new MinimaxPricingPageFetcher($httpClient, $requestFactory),
);

// Register $minimaxSource with the PriceSyncService used by ai-pricing-api.
// The application's `model-pricing:sync` command synchronizes its price sheets.

The fetcher defaults to https://platform.minimax.io/docs/pricing/overview.md and follows up to three HTTPS redirects. A different page URL can be supplied as the third MinimaxPricingPageFetcher constructor argument.

After a fetch, MinimaxPriceSource::getLastWarnings() returns warnings for unparseable rows that were skipped. A missing Image Generation pricing table raises PriceSourceException instead of producing guessed prices.

Supported image prices

  • Image Generation models are published with input, input_image, and output_image prices per one million tokens.
  • Legacy image models are published with an image price per unit.
  • All supported prices use USD and the standard service-tier condition.