Cloudflare
Cloudflare AI Gateway provides a unified interface to access multiple AI providers with enhanced observability, caching, and rate limiting. Braintrust automatically traces requests made through Cloudflare AI Gateway, giving you comprehensive observability for your AI applications.
Install the braintrust
and openai
packages.
pnpm add braintrust openai
Use wrapOpenAI
to automatically trace requests made through Cloudflare AI Gateway. Configure your client to use Cloudflare's unified API endpoint, and Braintrust will capture all requests, responses, and metrics.
Switching providers
Cloudflare AI Gateway's unified API allows you to easily switch between different AI providers by changing the model
parameter and corresponding API key. All requests are automatically traced by Braintrust regardless of which provider you use.
Supported providers include OpenAI, Anthropic, Google AI Studio, Groq, Mistral, Cohere, Perplexity, DeepSeek, Cerebras, xAI, and Workers AI. See the Cloudflare documentation for the complete list.