Skip to content
프로젝트

소개

Calculate prices for calling LLM inference APIs.

AI 및 머신러닝

이 수치를 측정하는 방법

What you can do

  • Advanced logic for matching on model and provider IDs to maximise the chance of using the correct model
  • Support for historic prices and prices changes, e.g. we have the prices for o3 before and after its price changed
  • Support for variable daily prices, e.g. we support calculating deepseek prices even with off-peak pricing
  • tiered pricing support for Gemini models where you pay a separate price for very large contexts

측정된 스타 증가

in 24h
+1
in 7 days
+8
in 15 days
+9
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

GenAI Prices

CI Coverage PyPI versions license Join Slack

Calculate prices for calling LLM inference APIs.

Features

  • Advanced logic for matching on model and provider IDs to maximise the chance of using the correct model
  • Support for historic prices and prices changes, e.g. we have the prices for o3 before and after its price changed
  • Support for variable daily prices, e.g. we support calculating deepseek prices even with off-peak pricing
  • tiered pricing support for Gemini models where you pay a separate price for very large contexts
  • support for identifying price discrepancies from other sources
  • Python package, CLI
  • JavaScript/TypeScript package, CLI
  • Go package
  • Rust crate
  • TODO: API and web UI

Providers

The following providers are currently supported:

Usage

Python Package & CLI

See the Python README for instructions on how to install and use the Python package and CLI.

JavaScript/TypeScript Package

See the JS/TS README for instructions on how to install and use the JavaScript/TypeScript package and CLI.

Go Package

See the Go README for instructions on how to install and use the Go package.

Rust Crate

See the Rust README for instructions on how to install and use the Rust crate.

Download data

Price data is available in the following files:

The v1 files below are frozen: they remain available so released clients keep working, but they no longer receive provider, model or price updates. Use the v2 files above for anything new.

Feel free to download these files and use them as you wish. We would be grateful if you would reference this project wherever you use it and contribute back to the project if you find any errors.

API

Coming soon...

⚠️ Warning: these prices will not be 100% accurate

This project is a best effort from Pydantic and the community to provide an indicative estimate of the price you might pay for calling an LLM.

The price data cannot be exactly correct because model providers do not provide exact price information for their APIs in a format which can be reliably processed.

If you get a bill you weren't expecting, don't blame us!

If you're a lawyer, please read the LICENSE under which this project is developed, hosted and distributed.

If you're a developer, please contribute to fix any missing or incorrect prices you find.

Contributing

We welcome contributions from the community and especially model/inference providers!

If you're a model provider: it would be amazing if you would serve a JSON file or API endpoint with pricing information which we could pull from. You would be the first AFAIK, and I think it would dramatically improve the experience for developers using your API!

Otherwise, to contribute:

  • See prices/README.md for instructions on how to contribute to the price data.
  • See benchmarks/README.md for the pricing performance benchmark workflow.
  • Feel free to submit pull requests or issues about the Python and JS packages.
  • If you need a library for another language, please create an issue, we'd be happy to discuss building it, hosting it here, or helping you maintain it elsewhere.

Part of the Pydantic Stack

The Pydantic Stack is everything you need to ship production-grade AI agents:

Thanks

This project would not be possible without the following existing data sources:

While none of these sources had exactly what we needed (hence creating this project), they (especially helicone) were used to populate some of the initial price database, and we continue to pull price updates from them.

Thanks to all those projects!

관련 프로젝트 살펴보기

불러오는 중…