Setup
Install the Braintrust SDK and OpenAI client:.env
Trace with Cloudflare AI Gateway
UsewrapOpenAI to automatically trace requests through Cloudflare’s unified API endpoint:
Switching providers
Cloudflare AI Gateway’s unified API allows you to easily switch between different AI providers by changing themodel parameter and corresponding API key. All requests are automatically traced by Braintrust regardless of which provider you use.