416 B
416 B
Code Example: How to track usage and cost
This folder contains the code for the Guides » Operations » Track usage and cost page in the documentation.
Run the example
- Set the
OPENAI_API_KEYenvironment variable. - Launch TensorZero:
docker compose up - Install the dependencies:
uv sync - Run the script:
uv run openai_sdk.py