adachsoft / model-pricing-source-deepseek
DeepSeek model pricing source for model-pricing-lib
Package info
gitlab.com/a.adach/model-pricing-source-deepseek
pkg:composer/adachsoft/model-pricing-source-deepseek
Requires
- php: ^8.3
- adachsoft/model-pricing-contracts: ^0.4
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
Requires (Dev)
- adachsoft/model-pricing-lib: ^0.1.0
- adachsoft/php-code-style: ^0.7.3
- friendsofphp/php-cs-fixer: ^3.95
- guzzlehttp/psr7: ^2.7
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.5
- rector/rector: ^2.8
- symplify/phpstan-rules: ^14.19
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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-chatanddeepseek-reasoneraliases 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.