Installation
Install the dexcost Python SDK with pip, including optional LLM provider extras.
pip install dexcostOptional 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:
| Provider | Install command |
|---|---|
| OpenAI | pip install "dexcost[openai]" — or pip install openai separately |
| Anthropic | pip install anthropic |
| LiteLLM | pip install litellm |
| Google Gemini | pip install google-genai |
| AWS Bedrock | pip install boto3 |
| Cohere | pip 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.