Installation¶
Zero external dependencies
Shekel requires no API keys, no external services, and no configuration. Install, wrap your calls in with budget():, and you're done.
Requirements¶
- Python 3.9 or higher
- OpenAI SDK (optional) — for OpenAI models
- Anthropic SDK (optional) — for Anthropic models
- LiteLLM (optional) — budget enforcement and circuit-breaking across 100+ providers via a unified interface
Install Shekel¶
Choose the installation option that matches your LLM provider:
OpenAI Only¶
If you're only using OpenAI models (GPT-4o, GPT-4o-mini, o1, etc.):
Anthropic Only¶
If you're only using Anthropic models (Claude 3.5 Sonnet, Claude 3 Haiku, etc.):
Both OpenAI and Anthropic¶
If you're using models from both providers:
Google Gemini¶
For Google Gemini via the google-genai SDK:
HuggingFace Inference API¶
For HuggingFace's InferenceClient:
LiteLLM (100+ Providers)¶
To enforce hard spend limits and circuit-break across OpenAI, Anthropic, Gemini, Cohere, Ollama, Azure, Bedrock, and 90+ more through a unified interface:
Extended Model Support (400+ Models)¶
For support of 400+ models via tokencost:
This includes models from Google (Gemini), Cohere, AI21, Aleph Alpha, and many more.
CLI Tools¶
To use the shekel command-line tools:
This enables commands like:
shekel estimate --model gpt-4o --input-tokens 1000 --output-tokens 500
shekel models
shekel models --provider openai
Development Installation¶
If you want to contribute to shekel or modify the source:
This installs shekel in editable mode with all development dependencies.
Verify Installation¶
After installation, verify that shekel is installed correctly:
You should see the version number printed (e.g., 0.2.2).
No API Keys Required¶
Unlike other cost tracking tools, shekel requires no API keys and no external services. It works by monkey-patching the OpenAI and Anthropic SDKs to track token usage and calculate costs locally.
Your existing API keys for OpenAI or Anthropic work as-is — shekel doesn't interfere with authentication.
Minimal Dependencies¶
Shekel has zero required dependencies beyond the Python standard library. The OpenAI and Anthropic SDKs are optional — install only what you need.
| Package | Required? | Purpose |
|---|---|---|
openai>=1.0.0 |
Optional | Track OpenAI API costs |
anthropic>=0.7.0 |
Optional | Track Anthropic API costs |
litellm>=1.0.0 |
Optional | Budget enforcement and circuit-breaking via LiteLLM (100+ providers) |
google-genai>=1.0.0 |
Optional | Track Google Gemini costs (native SDK) |
huggingface-hub>=0.20.0 |
Optional | Track HuggingFace Inference API costs |
tokencost>=0.1.0 |
Optional | Support 400+ models |
click>=8.0.0 |
Optional | CLI tools |
Troubleshooting¶
ImportError: No module named 'openai'¶
If you see this error, install the OpenAI SDK:
ImportError: No module named 'anthropic'¶
If you see this error, install the Anthropic SDK:
ImportError: No module named 'litellm'¶
If you see this error, install LiteLLM:
Model pricing not found¶
For models not in shekel's built-in pricing table:
- Install extended model support:
pip install shekel[all-models] - Or provide custom pricing:
budget(price_per_1k_tokens={"input": 0.001, "output": 0.003})
See Extending Shekel for more details.
Next Steps¶
- Quick Start Guide - Get started with basic examples
- Basic Usage - Learn the fundamentals
- API Reference - Full API documentation