How it works
Wrapping a client takes just a few lines of code and captures everything automatically:- Request inputs (messages, parameters)
- Model outputs (completions, tool calls)
- Metadata (model, temperature, token usage)
- Timing (start time, duration)
- Streaming chunks (if applicable)
- Errors and exceptions
Supported providers
Braintrust provides native wrappers for major AI providers:OpenAI
Wrap the OpenAI client to log GPT models, embeddings, and other OpenAI APIs. See the OpenAI integration guide for complete documentation.1
Install packages
2
Set API keys
3
Wrap the client
Anthropic
Wrap the Anthropic client to log Claude models. See the Anthropic integration guide for complete documentation.1
Install packages
2
Set API keys
3
Wrap the client
Google Gemini
Wrap the Google GenAI client to log Gemini models. See the Gemini integration guide for complete documentation.1
Install packages
2
Set API keys
3
Wrap the client
Other providers
Braintrust provides wrappers for many additional AI providers:AWS Bedrock
Claude, Llama, and other models on AWS
Azure OpenAI
OpenAI models hosted on Azure
Google Vertex AI
Gemini and other models on Google Cloud
Mistral
Mistral and Mixtral models
Together AI
Open-source models at scale
Groq
Ultra-fast LLM inference
Streaming support
Wrappers automatically handle streaming responses. No special configuration needed - just enable streaming in your API call and the wrapper collects all chunks and logs the complete request once streaming finishes.Stream from prompts
When executing prompts through the Braintrust API, you can stream results using Server-Sent Events (SSE). This works for both direct API calls and playground execution. Braintrust uses a simplified SSE format optimized for common LLM use cases:- Text streaming: For chat message content
- JSON streaming: For structured tool call arguments
- Progress events: For intermediate function execution steps
Next steps
- Integrate with frameworks like LangChain or OpenTelemetry
- Add custom tracing for non-LLM application logic
- View your logs in the Braintrust dashboard