Skip to main content
Once you’ve built and evaluated your AI application, Braintrust helps you deploy it to production with the same tools you used during development. Deploy prompts, functions, and agents through a unified API that works across any provider.

Why deploy with Braintrust

Deploying through Braintrust gives you:
  • Unified API: Call any AI provider (OpenAI, Anthropic, Google, AWS, etc.) through a single interface
  • Automatic observability: Every production request is logged and traceable
  • Caching: Reduce costs and latency with built-in response caching
  • Version control: Deploy prompts and functions with full version history
  • Environment management: Separate dev, staging, and production configurations
  • Fallbacks: Automatically retry failed requests with backup providers

Deploy prompts and functions

Prompts and functions created in Braintrust can be called from your application code. Changes to prompts in the UI immediately affect production behavior, enabling rapid iteration without redeployment.
const logger = initLogger({ projectName: "My Project" });

// Call a deployed prompt by slug
const response = await logger.invoke("my-prompt-slug", {
  input: { question: "What is the capital of France?" },
});
Deploy functions (tools, scorers, agents) the same way. Braintrust handles versioning, rollbacks, and observability automatically.

Use the AI Proxy

The AI Proxy provides a unified interface to call any AI provider through Braintrust. Use the OpenAI SDK with any provider:
import { OpenAI } from "openai";

const client = new OpenAI({
  baseURL: "https://api.braintrust.dev/v1/proxy",
  apiKey: process.env.BRAINTRUST_API_KEY,
});

// Use any provider's model
const response = await client.chat.completions.create({
  model: "claude-sonnet-4-5-20250929", // Anthropic model
  messages: [{ role: "user", content: "Hello!" }],
});
The proxy automatically logs requests, handles retries, and provides caching.

Manage environments

Environments separate your development, staging, and production configurations. Set different prompts, functions, or API keys per environment:
const logger = initLogger({
  projectName: "My Project",
  environment: "production",
});
Changes to development environments don’t affect production until you promote them.

Monitor deployments

Every production request flows through the same observability system you used during development. View logs, filter by errors, score online, and create dashboards to track performance. Set up alerts to notify you when error rates spike or latency exceeds thresholds.

Use the API

Access all Braintrust functionality through the Data API. Export logs, create datasets, run experiments, and manage prompts programmatically:
curl "https://api.braintrust.dev/v1/project/logs" \
  -H "Authorization: Bearer $BRAINTRUST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj_abc123",
    "btql": "input.question contains \"capital\""
  }'

Next steps