Welcome to the Braintrust API
The Braintrust API allows you to interact with all aspects of the Braintrust platform programmatically. You can use it to:- Create and manage projects, experiments, and datasets
- Log traces and metrics
- Manage prompts, tools, and scorers
- Configure access control and permissions
- Retrieve and analyze results
Base URL
The API is hosted globally at:Authentication
Most Braintrust endpoints are authenticated by providing your API key as a header to your HTTP request:SDKs
While you can call the API directly, we recommend using one of our official SDKs:API Resources
The API is organized around REST principles. Each resource has predictable URLs and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs.Core Resources
- Projects: Organize your AI features and experiments
- Experiments: Run and track evaluation experiments
- Datasets: Manage test data for evaluations
- Logs: Store and query production traces
- Prompts: Version control your prompts
- Functions: Manage tools, scorers, and agents
Organization Resources
- Organizations: Manage your organization settings
- Users: Manage team members
- Roles & ACLs: Configure access control
Response Format
All API responses are returned in JSON format. Successful responses will have a2xx status code, while errors will return 4xx or 5xx status codes with error details.
Rate Limits
The API uses rate limiting to ensure fair usage. Rate limits are applied per organization and endpoint. If you exceed the rate limit, you’ll receive a429 Too Many Requests response.
Support
Need help with the API?- Join our Discord community
- Check the GitHub repository
- Email us at support@braintrust.dev