Search by

adachsoft / model-pricing-source-zai

Arkadiusz Adach

Z.ai model pricing source for model-pricing-lib

Package info

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

Issues

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

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-17 21:32 UTC

This package is auto-updated.

Last update: 2026-11-17 20:32:25 UTC


README

A provider adapter for retrieving model pricing from Z.ai's official Markdown pricing page and converting supported token-pricing tables into validated price sheets for adachsoft/model-pricing-lib.

Features

  • Fetches pricing data using PSR-18 HTTP clients and PSR-17 request factories.
  • Parses supported input, cached-input, and output token prices.
  • Produces validated price sheets compatible with the model pricing contracts.
  • Reports fetch, parsing, and validation failures as PriceSourceException.

Requirements

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

Installation

Install this library alongside a PSR-18 client and PSR-17 request factory:

composer require adachsoft/model-pricing-source-zai

Usage

Create a ZaiPriceSource with your HTTP client and request factory, then call fetchPriceSheets() with the timestamp to associate with the fetched data. See usage examples.

The adapter reads the official Z.ai Markdown pricing page by default. Its URL can be overridden when constructing ZaiPricingPageFetcher, which is useful for testing or controlled deployments.