dexcost
Python

Installation

Install the dexcost Python SDK with pip, including optional LLM provider extras.

pip install dexcost

Optional extras

The [all] extra installs every LLM provider SDK that dexcost auto-instruments:

pip install "dexcost[all]"

This pulls in: openai>=1.0, anthropic>=0.18, litellm>=1.0, google-genai>=1.0, boto3>=1.34, and cohere>=5.0.

If you only use a subset of providers, install them individually to keep your dependency tree small:

ProviderInstall command
OpenAIpip install "dexcost[openai]" — or pip install openai separately
Anthropicpip install anthropic
LiteLLMpip install litellm
Google Geminipip install google-genai
AWS Bedrockpip install boto3
Coherepip install cohere

dexcost detects which of these packages are installed at runtime and instruments only those it finds; missing providers are silently skipped.

Requirements

Python 3.10 or later. The core package depends only on wrapt, click, pyyaml, and jsonschema — no LLM provider SDK is required for local tracking.

Verify your install

import dexcost

print(dexcost.__version__)

This prints the installed SDK version (for example, 0.1.0). If the import fails, check that your virtual environment is active and that pip install dexcost completed without errors.

On this page