Search by

adachsoft / model-pricing-source-deepseek

Arkadiusz Adach

DeepSeek model pricing source for model-pricing-lib

Package info

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

Issues

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

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-17 20:45 UTC

This package is auto-updated.

Last update: 2026-11-17 19:45:44 UTC


README

A PriceSourceInterface implementation that fetches DeepSeek's official Markdown pricing page and converts its model prices into validated price sheets for model-pricing-lib.

Features

  • Parses the official DeepSeek pricing table and creates USD price sheets for published models.
  • Represents input, cached-input, and output prices per one million tokens.
  • Includes standard service-tier and peak/off-peak time-band conditions on each price component.
  • Maps the legacy model names and the deepseek-chat and deepseek-reasoner aliases to the DeepSeek Flash prices.
  • Fetches pricing with PSR-18 and PSR-17 interfaces, allowing the host application to provide its HTTP client and request factory.

Long-context thresholds are not applied. Estimates must provide the applicable time_band (peak or off_peak) condition to match a pricing component. DeepSeek defines peak hours as 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday, excluding Chinese public holidays; other hours are off-peak.

Requirements

  • PHP 8.3 or later.
  • An application-provided PSR-18 HTTP client and PSR-17 request factory.

Installation

composer require adachsoft/model-pricing-source-deepseek

The host application must provide implementations of Psr\Http\Client\ClientInterface and Psr\Http\Message\RequestFactoryInterface.

Usage

See the usage example for constructing the source and fetching validated price sheets. The package makes an HTTP GET request to DeepSeek's official pricing page when fetchPriceSheets() is called.

Testing

The test suite uses the checked-in pricing fixture and fake PSR-18 responses; it does not make network requests.