freshcrate
Skin:/
Home > Frameworks > genai-prices

genai-prices

Calculate prices for calling LLM inference APIs.

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

<div align="center"> <h1>genai-prices</h1> </div> <div align="center"> <a href="https://github.com/pydantic/genai-prices/actions/workflows/ci.yml?query=branch%3Amain"><img src="https://github.com/pydantic/genai-prices/actions/workflows/ci.yml/badge.svg?event=push" alt="CI"></a> <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/genai-prices"><img src="https://coverage-badge.samuelcolvin.workers.dev/pydantic/genai-prices.svg" alt="Coverage"></a> <a href="https://pypi.python.org/pypi/genai-prices"><img src="https://img.shields.io/pypi/v/genai-prices.svg" alt="PyPI"></a> <a href="https://github.com/pydantic/genai-prices"><img src="https://img.shields.io/pypi/pyversions/genai-prices.svg" alt="versions"></a> <a href="https://github.com/pydantic/genai-prices/blob/main/LICENSE"><img src="https://img.shields.io/github/license/pydantic/genai-prices.svg" alt="license"></a> <a href="https://logfire.pydantic.dev/docs/join-slack/"><img src="https://img.shields.io/badge/Slack-Join%20Slack-4A154B?logo=slack" alt="Join Slack" /></a> </div> <br/> <div align="center"> Python package for <a href="https://github.com/pydantic/genai-prices">github.com/pydantic/genai-prices</a>. </div> <br/> ## Installation ```bash uv add genai-prices ``` (or `pip install genai-prices` if you're old school) To use the CLI with Rich output/help, install the optional CLI dependencies: ```bash uv add "genai-prices[cli]" ``` (or `pip install "genai-prices[cli]"`) ## Warning: these prices will not be 100% accurate See [the project README](https://github.com/pydantic/genai-prices?tab=readme-ov-file#warning) for more information. ## Usage ### `calc_price` ```python from genai_prices import Usage, calc_price price_data = calc_price( Usage(input_tokens=1000, output_tokens=100), model_ref='gpt-4o', provider_id='openai', ) print(f"Total Price: ${price_data.total_price} (input: ${price_data.input_price}, output: ${price_data.output_price})") ``` ### `extract_usage` `extract_usage` can be used to extract usage data and the `model_ref` from response data, which in turn can be used to calculate prices: ```py from genai_prices import extract_usage response_data = { 'model': 'claude-sonnet-4-20250514', 'usage': { 'input_tokens': 504, 'cache_creation_input_tokens': 123, 'cache_read_input_tokens': 0, 'output_tokens': 97, }, } extracted_usage = extract_usage(response_data, provider_id='anthropic') price = extracted_usage.calc_price() print(price.total_price) ``` or with OpenAI where there are two API flavors: ```py from genai_prices import extract_usage response_data = { 'model': 'gpt-5', 'usage': {'prompt_tokens': 100, 'completion_tokens': 200}, } extracted_usage = extract_usage(response_data, provider_id='openai', api_flavor='chat') price = extracted_usage.calc_price() print(price.total_price) ``` ### `UpdatePrices` `UpdatePrices` can be used to periodically update the price data by downloading it from GitHub Please note: - this functionality is explicitly opt-in - we download data directly from GitHub (`https://raw.githubusercontent.com/pydantic/genai-prices/refs/heads/main/prices/data.json`) so we don't and can't monitor requests or gather telemetry At the time of writing, the `data.json` file downloaded by `UpdatePrices` is around 26KB when compressed, so is generally very quick to download. By default `UpdatePrices` downloads price data immediately after it's started in the background, then every hour after that. Usage with `UpdatePrices` as as context manager: ```py from genai_prices import UpdatePrices, Usage, calc_price with UpdatePrices() as update_prices: update_prices.wait() # optionally wait for prices to have updated p = calc_price(Usage(input_tokens=123, output_tokens=456), 'gpt-5') print(p) ``` Usage with `UpdatePrices` as a simple class: ```py from genai_prices import UpdatePrices, Usage, calc_price update_prices = UpdatePrices() update_prices.start(wait=True) # start updating prices, optionally wait for prices to have updated p = calc_price(Usage(input_tokens=123, output_tokens=456), 'gpt-5') print(p) update_prices.stop() # stop updating prices ``` Only one `UpdatePrices` instance can be running at a time. If you'd like to wait for prices to be updated without access to the `UpdatePrices` instance, you can use the `wait_prices_updated_sync` function: ```py from genai_prices import wait_prices_updated_sync wait_prices_updated_sync() ... ``` Or it's async variant, `wait_prices_updated_async`. ### CLI Usage Run the CLI with: ```bash uvx genai-prices --help ``` Or, if installed locally, make sure CLI extras are present: ```bash pip install "genai-prices[cli]" genai-prices --help ``` If local CLI extras are not installed, the command will print an install hint for `genai-prices[cli]`. To list providers and models, run: ```bash uvx genai-prices list ``` To calculate the price of models, run f

Release History

VersionChangesUrgencyDate
v0.0.63## What's Changed * Add Claude Opus 4.8 pricing by @dsfaccini in https://github.com/pydantic/genai-prices/pull/389 * Update deepseek-v4-pro to new permanent pricing by @MarkusWendorf in https://github.com/pydantic/genai-prices/pull/391 * Google and Mistral AI models on AWS by @mahiuchun in https://github.com/pydantic/genai-prices/pull/392 * Prep 0.0.63 release by @dmontagu in https://github.com/pydantic/genai-prices/pull/393 ## New Contributors * @MarkusWendorf made their first contribution in High6/5/2026
v0.0.62## What's Changed * feat: add Gemini 3.5 Flash pricing by @dsfaccini in https://github.com/pydantic/genai-prices/pull/379 * Drop Python 3.9 support by @alexmojaki in https://github.com/pydantic/genai-prices/pull/380 * Consolidate Python CLI implementation by @alexmojaki in https://github.com/pydantic/genai-prices/pull/382 * Improve Python test coverage by @alexmojaki in https://github.com/pydantic/genai-prices/pull/381 * Add amazon provider match for aws by @Yun-Kim in https://github.com/pyHigh5/25/2026
v0.0.61## What's Changed * chore: update gpt-5.5 aliases by @ddanielcruzz in https://github.com/pydantic/genai-prices/pull/376 * Prep 0.0.61 release by @ddanielcruzz in https://github.com/pydantic/genai-prices/pull/377 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.60...v0.0.61High5/19/2026
v0.0.60## What's Changed * Introduce zizmor by @Viicos in https://github.com/pydantic/genai-prices/pull/362 * Fix npm release publishing by @SmileMachine in https://github.com/pydantic/genai-prices/pull/363 * Support GA version of Gemini 3.1 Flash-Lite by @mahiuchun in https://github.com/pydantic/genai-prices/pull/366 * Fix Google tool-use prompt token count mapping by @alexmojaki in https://github.com/pydantic/genai-prices/pull/370 * Split independent pricing fixes by @alexmojaki in https://githuHigh5/15/2026
v0.0.59## What's Changed * Add OpenRouter date-suffixed Claude 4.5 model aliases by @nirnaim in https://github.com/pydantic/genai-prices/pull/319 * Keep `_background_task` alive to update_prices after failed attempts by @adtyavrdhn in https://github.com/pydantic/genai-prices/pull/323 * Update OpenRouter Claude 4.6 pricing and add dated aliases by @nirnaim in https://github.com/pydantic/genai-prices/pull/320 * Add Nvidia Nemotron Bedrock models pricing by @rian-dolphin in https://github.com/pydanticHigh5/7/2026
0.0.57Imported from PyPI (0.0.57)Low4/21/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.56## What's Changed * feat: add gpt-5.3-codex pricing by @sigglep in https://github.com/pydantic/genai-prices/pull/301 * feat: add Gemini 3.1 Flash Lite (Preview) pricing by @rian-dolphin in https://github.com/pydantic/genai-prices/pull/302 * feat: refactor python cli with rich output and pydantic-settings by @Else00 in https://github.com/pydantic/genai-prices/pull/278 * Loosen matchers for regional-only AWS Claude 3.* models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/305 Low3/20/2026
v0.0.55## What's Changed * Loosen AWS model matchers to support inference profiles by @alexmojaki in https://github.com/pydantic/genai-prices/pull/292 * Add AWS Bedrock pricing for Claude Opus 4.5, Opus 4.6, Sonnet 4.6 by @EmilioEsposito in https://github.com/pydantic/genai-prices/pull/294 * feat: add Gemini 3.1 Pro (Preview) by @mathislucka in https://github.com/pydantic/genai-prices/pull/293 * Prep 0.0.55 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/298 ## New ContriLow2/26/2026
v0.0.54## What's Changed * Add Claude Sonnet 4.6 by @DouweM in https://github.com/pydantic/genai-prices/pull/286 * feat: add model lifecycle management (deprecated & removed) by @Kludex in https://github.com/pydantic/genai-prices/pull/284 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.53...v0.0.54Low2/17/2026
v0.0.53## What's Changed * feat: add Claude Opus 4.6 pricing by @dsfaccini in https://github.com/pydantic/genai-prices/pull/277 * fix: add missing OpenAI GPT-5.x model name aliases by @atsaplin in https://github.com/pydantic/genai-prices/pull/281 * fix new qwen3-max (thinking) model name by @dsfaccini in https://github.com/pydantic/genai-prices/pull/275 * feat: Adding support for additional Fireworks.ai models by @jlegewie in https://github.com/pydantic/genai-prices/pull/276 ## New Contributors Low2/11/2026
v0.0.52## What's Changed * Add Python tests for model fallback matching by @Copilot in https://github.com/pydantic/genai-prices/pull/263 * feat: add gpt-5.2-codex by @ddanielcruzz in https://github.com/pydantic/genai-prices/pull/267 * feat: Adding grok-4-fast in addition to grok-4-1-fast by @brightsparc in https://github.com/pydantic/genai-prices/pull/268 * Specially handle litellm provider so that price calculation is possible by @vikigenius in https://github.com/pydantic/genai-prices/pull/271 * Low1/28/2026
v0.0.51## What's Changed * Update js sdk docs with custom provider instructions by @saeedesmaili in https://github.com/pydantic/genai-prices/pull/257 * Add Claude 4.5 models to OpenRouter pricing by @nirnaim in https://github.com/pydantic/genai-prices/pull/261 * Enforce unique model matching by @alexmojaki in https://github.com/pydantic/genai-prices/pull/262 * Fallback model providers by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/255 * Prep 0.0.51 release by @alexmojaki in httpLow1/13/2026
v0.0.50## What's Changed * add prices for gemini 3 flash and pro image preview by @dsfaccini in https://github.com/pydantic/genai-prices/pull/254 * Adding prices for grok-4-1-fast and grok-code-fast-1 by @brightsparc in https://github.com/pydantic/genai-prices/pull/256 * Fix #241 Tiered pricing calculation by @hilikpaz in https://github.com/pydantic/genai-prices/pull/242 * Prep 0.0.50 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/258 ## New Contributors * @dsfaccini maLow1/6/2026
v0.0.49## What's Changed * feat: add Qwen3-Coder-480B-A35B-Instruct model with pricing details by @iyehuda in https://github.com/pydantic/genai-prices/pull/248 * feat: Update Hugging Face prices by @eliasto in https://github.com/pydantic/genai-prices/pull/249 * Add OVHcloud AI Endpoints provider prices and auto-script by @eliasto in https://github.com/pydantic/genai-prices/pull/250 * Prep 0.0.49 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/252 ## New Contributors * @iLow12/17/2025
v0.0.48## What's Changed * fix: broken link to openrouter in readme by @juanfabrega in https://github.com/pydantic/genai-prices/pull/227 * feat: adding latest x-ai models by @juanfabrega in https://github.com/pydantic/genai-prices/pull/228 * Update OpenAI models by @juanfabrega in https://github.com/pydantic/genai-prices/pull/231 * Test dataset misc enhancements by @alexmojaki in https://github.com/pydantic/genai-prices/pull/230 * AWS prices automation by @alexmojaki in https://github.com/pydanticLow12/12/2025
v0.0.47## What's Changed * chore(*): soften httpx python dependency by @forforeach in https://github.com/pydantic/genai-prices/pull/226 ## New Contributors * @forforeach made their first contribution in https://github.com/pydantic/genai-prices/pull/226 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.46...v0.0.47Low11/25/2025
v0.0.46## What's Changed * Update huggingface prices by @alexmojaki in https://github.com/pydantic/genai-prices/pull/222 * lowercase huggingface models by @Kludex in https://github.com/pydantic/genai-prices/pull/223 * Prep 0.0.46 release by @Kludex in https://github.com/pydantic/genai-prices/pull/225 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.45...v0.0.46Low11/25/2025
v0.0.45## What's Changed * Huggingface prices by @alexmojaki in https://github.com/pydantic/genai-prices/pull/218 * feat: add prices for claude opus 4.5 by @pedrurrego in https://github.com/pydantic/genai-prices/pull/219 * Prep 0.0.45 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/221 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.44...v0.0.45Low11/25/2025
v0.0.44## What's Changed * feat(azure): add extractors by @Kludex in https://github.com/pydantic/genai-prices/pull/216 * Prep 0.0.44 release by @Kludex in https://github.com/pydantic/genai-prices/pull/217 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.43...v0.0.44Low11/21/2025
v0.0.43## What's Changed * AWS Anthropic model prices by @alexmojaki in https://github.com/pydantic/genai-prices/pull/211 * Loosen AWS anthropic model matchers by @alexmojaki in https://github.com/pydantic/genai-prices/pull/212 * Support AWS anthropic in all regions by @alexmojaki in https://github.com/pydantic/genai-prices/pull/213 * feat(anthropic): support chat completions by @Kludex in https://github.com/pydantic/genai-prices/pull/214 * Version 0.0.43 by @Kludex in https://github.com/pydantic/Low11/21/2025
v0.0.42## What's Changed * Add AWS prices from API by @alexmojaki in https://github.com/pydantic/genai-prices/pull/208 * Add anthropic extractor to AWS prices by @Kludex in https://github.com/pydantic/genai-prices/pull/209 * Version 0.0.42 by @Kludex in https://github.com/pydantic/genai-prices/pull/210 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.41...v0.0.42Low11/19/2025
v0.0.41## What's Changed * Add Gemini 3.0 by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/206 * Prep 0.0.41 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/207 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.40...v0.0.41Low11/18/2025
v0.0.40## What's Changed * Account for toolUsePromptTokenCount in google models by @alexmojaki in https://github.com/pydantic/genai-prices/pull/200 * Fix extraction of google usage by @alexmojaki in https://github.com/pydantic/genai-prices/pull/203 * Missing OpenAI models: computer-use and gpt-5.1-codex-mini by @alexmojaki in https://github.com/pydantic/genai-prices/pull/201 * Prep 0.0.40 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/204 **Full Changelog**: https://giLow11/18/2025
v0.0.39## What's Changed * Groq prices fixes by @alexmojaki in https://github.com/pydantic/genai-prices/pull/194 * Cerebras Support by @robotrory in https://github.com/pydantic/genai-prices/pull/191 * enh: add openai embedding usage extractor by @tzing in https://github.com/pydantic/genai-prices/pull/159 * chore: Update usages.json with gpt-5-pro example by @alexmojaki in https://github.com/pydantic/genai-prices/pull/195 * Loosen AWS model matches, update prices by @alexmojaki in https://github.coLow11/13/2025
v0.0.38## What's Changed * Support failure mode for updatePrices factory by @petyosi in https://github.com/pydantic/genai-prices/pull/192 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.37...v0.0.38Low11/10/2025
v0.0.37## What's Changed * feat(openrouter): add deepseek models that were missing by @lironesamoun in https://github.com/pydantic/genai-prices/pull/172 * feat(google): add nano banana (gemini-2.5-flash-image) by @robotrory in https://github.com/pydantic/genai-prices/pull/177 * Fix dataset tests: timestamp and precision by @alexmojaki in https://github.com/pydantic/genai-prices/pull/184 * Allow running `price_discrepancies.py` directly from PyCharm by @alexmojaki in https://github.com/pydantic/genaLow11/7/2025
v0.0.36## What's Changed * Extend OpenRouter support for Google Gemini 2.5 models by @lionpeloux in https://github.com/pydantic/genai-prices/pull/160 * Add usages test dataset by @alexmojaki in https://github.com/pydantic/genai-prices/pull/176 * Fix JS extraction errors for optional fields, test against dataset by @alexmojaki in https://github.com/pydantic/genai-prices/pull/178 * Fix JS pricing calculation by @alexmojaki in https://github.com/pydantic/genai-prices/pull/179 * Prep 0.0.36 release byLow11/5/2025
v0.0.35## What's Changed * Update simonw llm-prices url by @Kludex in https://github.com/pydantic/genai-prices/pull/168 * Add anthropic extractor to Google Vertex by @Kludex in https://github.com/pydantic/genai-prices/pull/169 * Version 0.0.35 by @Kludex in https://github.com/pydantic/genai-prices/pull/170 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.34...v0.0.35Low10/19/2025
v0.0.34## What's Changed * prices for claude haiku 4.5 by @pedrurrego in https://github.com/pydantic/genai-prices/pull/165 * Version 0.0.34 by @Kludex in https://github.com/pydantic/genai-prices/pull/167 ## New Contributors * @pedrurrego made their first contribution in https://github.com/pydantic/genai-prices/pull/165 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.33...v0.0.34Low10/16/2025
v0.0.33## What's Changed * fix: add `audio` field on OpenRouter script by @Kludex in https://github.com/pydantic/genai-prices/pull/162 * fix(aws): update match statement by @Kludex in https://github.com/pydantic/genai-prices/pull/163 * Version 0.0.33 by @Kludex in https://github.com/pydantic/genai-prices/pull/166 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.32...v0.0.33Low10/16/2025
v0.0.32## What's Changed * feat(aws): extract prices on AWS Bedrock models by @Kludex in https://github.com/pydantic/genai-prices/pull/158 * Version 0.0.32 by @Kludex in https://github.com/pydantic/genai-prices/pull/161 ## New Contributors * @Kludex made their first contribution in https://github.com/pydantic/genai-prices/pull/158 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.31...v0.0.32Low10/15/2025
v0.0.31## What's Changed * Extract OpenAI `input_audio_tokens` by @alexmojaki in https://github.com/pydantic/genai-prices/pull/155 * Correctly account for output audio tokens in calculation by @alexmojaki in https://github.com/pydantic/genai-prices/pull/156 * Prep 0.0.31 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/157 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.30...v0.0.31Low10/9/2025
v0.0.30## What's Changed * Better handle missing optional fields when extracting usage by @alexmojaki in https://github.com/pydantic/genai-prices/pull/153 * Prep 0.0.30 release by @alexmojaki in https://github.com/pydantic/genai-prices/pull/154 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.29...v0.0.30Low10/7/2025
v0.0.29## What's Changed * prices for claude sonnet 4.5 by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/150 * Prep 0.0.29 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/151 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.28...v0.0.29Low9/29/2025
v0.0.28## What's Changed * Extract `input_audio_tokens` for Google, account for (cached) audio in price by @alexmojaki in https://github.com/pydantic/genai-prices/pull/141 * Add clauses for openrouter google/gemini-2.5-pro by @alexmojaki in https://github.com/pydantic/genai-prices/pull/148 * Relax pydantic dependency requirement to 2.10 by @jerry-heygen in https://github.com/pydantic/genai-prices/pull/147 * Prep 0.0.28 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/149 Low9/27/2025
v0.0.27## What's Changed * add license file by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/137 * make `thoughtsTokenCount` optional by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/139 * Prep 0.0.27 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/140 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.26...v0.0.27Low9/10/2025
v0.0.26## What's Changed * add `thoughtsTokenCount` to `output_tokens` for gemini by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/135 * Prep 0.0.26 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/136 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.25...v0.0.26Low9/10/2025
v0.0.25## What's Changed * Upgrade uv_build to latest to fix wheel permissions issue by @edaniels in https://github.com/pydantic/genai-prices/pull/131 * Prep 0.0.25 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/133 ## New Contributors * @edaniels made their first contribution in https://github.com/pydantic/genai-prices/pull/131 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.24...v0.0.25Low9/1/2025
v0.0.24## What's Changed * Google vertex usage by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/129 * Prep 0.0.24 release by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/130 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.23...v0.0.24Low8/26/2025
v0.0.23## What's Changed * change extraction logic for Anthropic by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/125 * Fix gpt-5-nano by @petyosi in https://github.com/pydantic/genai-prices/pull/128 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.22...v0.0.23Low8/18/2025
v0.0.22## What's Changed * add `findProvider` to js public interface by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/120 * test against known provider and model names by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/121 **Full Changelog**: https://github.com/pydantic/genai-prices/compare/v0.0.21...v0.0.22Low8/12/2025
v0.0.21## What's Changed * Extract `Usage` from API responses by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/116 * Simplify API to `calcPrice` by @petyosi in https://github.com/pydantic/genai-prices/pull/117 * New Python API by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/118 * prep release of v0.0.21 by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/119 ## New Contributors * @petyosi made their first contribution in https://github.com/pydantLow8/11/2025
v0.0.20## What's Changed * improve fireworks prices by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/36 * improvements to azure prices by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/39 * fix some google prices by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/40 * format YAML and other files with prettier by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/41 * add js package by @GSemikozov in https://github.com/pydantic/genai-priceLow8/9/2025
@pydantic/genai-prices@0.0.18### Patch Changes - fd67740: fix js publish step name Low8/7/2025
@pydantic/genai-prices@0.0.17### Patch Changes - fa4be16: test publish Low8/7/2025
@pydantic/genai-prices@0.0.16### Patch Changes - f4ce9f7: test publish Low8/7/2025
@pydantic/genai-prices@0.0.15### Patch Changes - a93a9b1: test publish Low8/6/2025
@pydantic/genai-prices@0.0.14### Patch Changes - 51ea624: test publish Low8/6/2025
@pydantic/genai-prices@0.0.13### Patch Changes - 694241a: test publish Low8/6/2025
@pydantic/genai-prices@0.0.12### Patch Changes - 1210931: test publish - 1210931: test publish Low8/6/2025
genai-prices@0.0.12### Patch Changes - 1210931: test publish - 1210931: test publish Low8/6/2025
@pydantic/genai-prices@0.0.8# @pydantic/genai-prices ## 1.0.0 ### Major Changes - separate input and output prices - improve matcher for providers and models Low8/1/2025
@pydantic/genai-prices@0.0.7**Full Changelog**: https://github.com/pydantic/genai-prices/compare/@pydantic/genai-prices@0.0.7...@pydantic/genai-prices@0.0.7Low7/31/2025
@pydantic/genai-prices@0.0.6# @pydantic/genai-prices ## 1.0.0 ### Major Changes - 339c2b5: Initial release of the JavaScript/TypeScript package for calculating LLM API prices. This package provides both sync and async APIs for price calculation across multiple providers including OpenAI, Anthropic, and others. Low7/23/2025
v0.0.3fix dependencies.Low7/13/2025
v0.0.2## What's Changed * Grok 4 pricing by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/30 * README improvements by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/31 * inject providers into README by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/33 * readme tweaks by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/34 * Adding a python CLI by @samuelcolvin in https://github.com/pydantic/genai-prices/pull/35 **Full Changelog**:Low7/13/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

schemathesisProperty-based testing framework for Open API and GraphQL based appsv4.21.1
ctranslate2Fast inference engine for Transformer modelsv4.8.0
cadwynProduction-ready community-driven modern Stripe-like API versioning in FastAPI7.0.0
tqdmFast, Extensible Progress Meterv4.68.1
inspect-aiFramework for large language model evaluationsmain@2026-06-05

More in Frameworks

spec_driven_developSpec-Driven Develop is a platform-agnostic AI agent skill that automates the pre-development workflow for large-scale complex tasks. It is not a framework, not a runtime, not a package manager — it is
deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of ta
simBuild, deploy, and orchestrate AI agents. Sim is the central intelligence layer for your AI workforce.
ctranslate2Fast inference engine for Transformer models