573 B
573 B
Guide: How to use OpenAI embedding models with TensorZero
Running the Example
- Set the
OPENAI_API_KEYenvironment variable:
export OPENAI_API_KEY="sk-..." # Replace with your OpenAI API key
- Launch the TensorZero Gateway:
docker compose up
- Run the example (in a separate terminal):
Python (OpenAI SDK)
a. Install the Python dependencies. We recommend using uv:
uv sync
b. Run the example:
uv run openai_sdk.py