# Track LLM API Costs with genai-prices

DevFeed: [Track LLM API Costs with genai-prices](<https://devfeed.tech/articles/track-llm-api-costs-with-genai-prices-30863.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/track-llm-api-costs-with-genai-prices/>)

Author: Rick Donato

Published: 2026-09-01T11:16:32Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [API](<https://devfeed.tech/topics/api.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Library](<https://devfeed.tech/topics/library.md>), [Python](<https://devfeed.tech/topics/python.md>), [Binance](<https://devfeed.tech/topics/binance.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [cost](<https://devfeed.tech/tags/cost.md>), [example](<https://devfeed.tech/tags/example.md>), [genai](<https://devfeed.tech/tags/genai.md>), [inference](<https://devfeed.tech/tags/inference.md>), [install](<https://devfeed.tech/tags/install.md>), [library](<https://devfeed.tech/tags/library.md>), [llm](<https://devfeed.tech/tags/llm.md>), [openai](<https://devfeed.tech/tags/openai.md>), [pricing](<https://devfeed.tech/tags/pricing.md>), [python](<https://devfeed.tech/tags/python.md>), [report](<https://devfeed.tech/tags/report.md>), [request](<https://devfeed.tech/tags/request.md>), [tips](<https://devfeed.tech/tags/tips.md>), [token](<https://devfeed.tech/tags/token.md>), [uv](<https://devfeed.tech/tags/uv.md>)

## AI overview

A tutorial introducing the genai-prices Python library for estimating the cost of calling LLM inference APIs. It explains that the library can avoid maintaining a custom pricing table and can report token counts and cost for each request, with an OpenAI installation and usage example.

## Source excerpt

Tip: Use the genai-prices Python library to calculate the estimated cost of calling LLM inference APIs. This avoids maintaining your own pricing table and lets you report token counts and cost for each request. Below is an example: # Install: uv add openai genai-prices from openai import OpenAI from