Learn how to call any LLM with a unified API using the TensorZero Gateway.
Set up the credentials for your LLM provider
OPENAI_API_KEY
environment variable with your API key.Install the TensorZero Python SDK
pip
.Initialize the TensorZero Gateway
TensorZeroGateway
client and an asynchronous AsyncTensorZeroGateway
client.
Both options support running the gateway embedded in your application with build_embedded
or connecting to a standalone gateway with build_http
.
See Clients for more details.Call the LLM
Sample Response