> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Braintrust integration

> Give Guild agents access to Braintrust: manage projects, datasets, experiments, prompts, evaluations, functions, and access controls.

Agents can create and manage Braintrust projects, datasets, experiments, and prompts. They can launch evaluations, fetch experiment and dataset events, and review summarized results. Access control, API keys, environment variables, and service tokens can also be managed. The integration is `guildai~braintrust`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as a bearer token in the `Authorization` header

### Setup

**1. Connect Braintrust**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **braintrust**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { BraintrustTools } from "@guildai-services/guildai~braintrust"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with Braintrust.",
  tools: { ...BraintrustTools },
})
```

### Selecting specific tools

Tools are named with the `braintrust_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~braintrust`:

> [accordion] All 156 tools
>
> | Tool | What it does |
> | - | - |
> | `braintrust_acl_batch_update` | Batch update ACLs. |
> | `braintrust_acl_list_org` | List all ACLs in the org. |
> | `braintrust_create_environment` | Create a new environment |
> | `braintrust_create_ingest_key` | Create a publishable key for one existing project. |
> | `braintrust_delete_acl` | Delete a single ACL |
> | `braintrust_delete_acl_id` | Delete an ACL object by its id |
> | `braintrust_delete_ai_secret` | Delete a single AI secret |
> | `braintrust_delete_ai_secret_id` | Delete an AI secret object by its id |
> | `braintrust_delete_api_key_id` | Delete an API key object by its id |
> | `braintrust_delete_custom_column_id` | Delete a custom column object by its id. |
> | `braintrust_delete_dataset_id` | Delete a dataset object by its id |
> | `braintrust_delete_dataset_snapshot_id` | Delete a dataset snapshot object by its id |
> | `braintrust_delete_environment` | Delete an environment object by its id |
> | `braintrust_delete_env_var_id` | Delete an env var object by its id |
> | `braintrust_delete_experiment_id` | Delete an experiment object by its id |
> | `braintrust_delete_function_id` | Delete a function object by its id |
> | `braintrust_delete_group_id` | Delete a group object by its id |
> | `braintrust_delete_ingest_key` | Revoke an ingest key. |
> | `braintrust_delete_mcp_server_id` | Delete an MCP server object by its id |
> | `braintrust_delete_project_automation_id` | Delete a project automation object by its id |
> | `braintrust_delete_project_group_id` | Delete a project group object by its id |
> | `braintrust_delete_project_id` | Delete a project object by its id |
> | `braintrust_delete_project_score_id` | Delete a project score object by its id |
> | `braintrust_delete_project_tag_id` | Delete a project tag object by its id |
> | `braintrust_delete_prompt_id` | Delete a prompt object by its id |
> | `braintrust_delete_role_id` | Delete a role object by its id |
> | `braintrust_delete_service_token` | Delete a single service token |
> | `braintrust_delete_service_token_id` | Delete a service token object by its id |
> | `braintrust_delete_span_iframe_id` | Delete a span iframe object by its id |
> | `braintrust_delete_view_id` | Delete a view object by its id |
> | `braintrust_eval_launch` | Launch an evaluation. |
> | `braintrust_get_acl` | List out all ACLs. |
> | `braintrust_get_acl_id` | Get an ACL object by its id |
> | `braintrust_get_ai_secret` | List out all AI secrets. |
> | `braintrust_get_ai_secret_id` | Get an AI secret object by its id |
> | `braintrust_get_api_key` | List out all API keys. |
> | `braintrust_get_api_key_id` | Get an API key object by its id |
> | `braintrust_get_custom_column` | List the custom columns defined for a table. |
> | `braintrust_get_dataset` | List out all datasets. |
> | `braintrust_get_dataset_id` | Get a dataset object by its id |
> | `braintrust_get_dataset_id_fetch` | Fetch the events in a dataset. |
> | `braintrust_get_dataset_id_summarize` | Return the dataset and project names and URLs. |
> | `braintrust_get_dataset_snapshot` | List out all dataset snapshots. |
> | `braintrust_get_dataset_snapshot_id` | Get a dataset snapshot object by its id |
> | `braintrust_get_environment` | Get an environment object by its id |
> | `braintrust_get_env_var` | List out all env vars. |
> | `braintrust_get_env_var_id` | Get an env var object by its id |
> | `braintrust_get_experiment` | List out all experiments. |
> | `braintrust_get_experiment_id` | Get an experiment object by its id |
> | `braintrust_get_experiment_id_fetch` | Fetch the events in an experiment. |
> | `braintrust_get_experiment_id_summarize` | Return the experiment and project names and URLs. |
> | `braintrust_get_function` | List out all functions. |
> | `braintrust_get_function_id` | Get a function object by its id |
> | `braintrust_get_group` | List out all groups. |
> | `braintrust_get_group_id` | Get a group object by its id |
> | `braintrust_get_mcp_server` | List out all MCP servers. |
> | `braintrust_get_mcp_server_id` | Get an MCP server object by its id |
> | `braintrust_get_organization` | List out all organizations. |
> | `braintrust_get_organization_api_keys` | List all API keys associated with users in an organization, sorted by creation date with the newest keys first. |
> | `braintrust_get_organization_id` | Get an organization object by its id |
> | `braintrust_get_project` | List out all projects. |
> | `braintrust_get_project_automation` | List out all project automations. |
> | `braintrust_get_project_automation_id` | Get a project automation object by its id |
> | `braintrust_get_project_group` | List out all project groups. |
> | `braintrust_get_project_group_id` | Get a project group object by its id |
> | `braintrust_get_project_id` | Get a project object by its id |
> | `braintrust_get_project_logs_id_fetch` | Fetch the events in a project logs. |
> | `braintrust_get_project_score` | List out all project scores. |
> | `braintrust_get_project_score_id` | Get a project score object by its id |
> | `braintrust_get_project_tag` | List out all project tags. |
> | `braintrust_get_project_tag_id` | Get a project tag object by its id |
> | `braintrust_get_prompt` | List out all prompts. |
> | `braintrust_get_prompt_id` | Get a prompt object by its id |
> | `braintrust_get_role` | List out all roles. |
> | `braintrust_get_role_id` | Get a role object by its id |
> | `braintrust_get_service_token` | List out all service tokens. |
> | `braintrust_get_service_token_id` | Get a service token object by its id |
> | `braintrust_get_span_iframe` | List out all span iframes. |
> | `braintrust_get_span_iframe_id` | Get a span iframe object by its id |
> | `braintrust_get_user` | List out all users. |
> | `braintrust_get_user_id` | Get a user object by its id |
> | `braintrust_get_view` | List out all views. |
> | `braintrust_get_view_id` | Get a view object by its id |
> | `braintrust_list_environments` | List out all environments. |
> | `braintrust_list_ingest_keys` | List ingest keys for a project, newest first, including their complete copyable configuration URLs. |
> | `braintrust_patch_ai_secret_id` | Partially update an AI secret object. |
> | `braintrust_patch_custom_column_id` | Update the name or expression of a custom column. |
> | `braintrust_patch_dataset_id` | Partially update a dataset object. |
> | `braintrust_patch_dataset_snapshot_id` | Partially update a dataset snapshot object. |
> | `braintrust_patch_env_var_id` | Partially update an env var object. |
> | `braintrust_patch_experiment_id` | Partially update an experiment object. |
> | `braintrust_patch_function_id` | Partially update a function object. |
> | `braintrust_patch_group_id` | Partially update a group object. |
> | `braintrust_patch_mcp_server_id` | Partially update an MCP server object. |
> | `braintrust_patch_organization_id` | Partially update an organization object. |
> | `braintrust_patch_organization_members` | Add or remove members, create service accounts. |
> | `braintrust_patch_project_automation_id` | Partially update a project automation object. |
> | `braintrust_patch_project_group_id` | Partially update a project group object. |
> | `braintrust_patch_project_id` | Partially update a project object. |
> | `braintrust_patch_project_score_id` | Partially update a project score object. |
> | `braintrust_patch_project_tag_id` | Partially update a project tag object. |
> | `braintrust_patch_prompt_id` | Partially update a prompt object. |
> | `braintrust_patch_role_id` | Partially update a role object. |
> | `braintrust_patch_span_iframe_id` | Partially update a span iframe object. |
> | `braintrust_patch_view_id` | Partially update a view object. |
> | `braintrust_post_acl` | Create a new ACL. |
> | `braintrust_post_ai_secret` | Create a new AI secret. |
> | `braintrust_post_cross_object_insert` | Insert events and feedback across object types |
> | `braintrust_post_custom_column` | Create a new custom column. |
> | `braintrust_post_dataset` | Create a new dataset. |
> | `braintrust_post_dataset_id_feedback` | Log feedback for a set of dataset events |
> | `braintrust_post_dataset_id_fetch` | Fetch the events in a dataset. |
> | `braintrust_post_dataset_id_insert` | Insert a set of events into the dataset |
> | `braintrust_post_dataset_id_restore` | Restore a dataset to an earlier version, such as a dataset snapshot. |
> | `braintrust_post_dataset_id_restore_preview` | Preview restoring a dataset to an earlier version, such as a dataset snapshot. |
> | `braintrust_post_dataset_snapshot` | Create a new dataset snapshot. |
> | `braintrust_post_env_var` | Create a new env var. |
> | `braintrust_post_experiment` | Create a new experiment. |
> | `braintrust_post_experiment_id_feedback` | Log feedback for a set of experiment events |
> | `braintrust_post_experiment_id_fetch` | Fetch the events in an experiment. |
> | `braintrust_post_experiment_id_insert` | Insert a set of events into the experiment |
> | `braintrust_post_function` | Create a new function. |
> | `braintrust_post_function_id_invoke` | Run the specified function with the provided input and return its result. |
> | `braintrust_post_group` | Create a new group. |
> | `braintrust_post_mcp_server` | Create a new MCP server. |
> | `braintrust_post_project` | Create a new project. |
> | `braintrust_post_project_automation` | Create a new project automation. |
> | `braintrust_post_project_group` | Create a new project group. |
> | `braintrust_post_project_logs_id_feedback` | Log feedback for a set of project logs events |
> | `braintrust_post_project_logs_id_fetch` | Fetch the events in a project logs. |
> | `braintrust_post_project_logs_id_insert` | Insert a set of events into the project logs |
> | `braintrust_post_project_score` | Create a new project score. |
> | `braintrust_post_project_tag` | Create a new project tag. |
> | `braintrust_post_prompt` | Create a new prompt. |
> | `braintrust_post_role` | Create a new role. |
> | `braintrust_post_service_token` | Create a new service token. |
> | `braintrust_post_span_iframe` | Create a new span iframe. |
> | `braintrust_post_view` | Create a new view. |
> | `braintrust_proxycredentials` | Create a temporary credential which can access the proxy for a limited time. |
> | `braintrust_put_ai_secret` | Create or replace AI secret. |
> | `braintrust_put_custom_column` | Create or replace a custom column. |
> | `braintrust_put_dataset_snapshot` | Create or replace dataset snapshot. |
> | `braintrust_put_env_var` | Create or replace env var. |
> | `braintrust_put_function` | Create or replace function. |
> | `braintrust_put_group` | Create or replace group. |
> | `braintrust_put_mcp_server` | Create or replace MCP server. |
> | `braintrust_put_project_automation` | Create or replace project automation. |
> | `braintrust_put_project_group` | Create or replace project group. |
> | `braintrust_put_project_score` | Create or replace project score. |
> | `braintrust_put_project_tag` | Create or replace project tag. |
> | `braintrust_put_prompt` | Create or replace prompt. |
> | `braintrust_put_role` | Create or replace role. |
> | `braintrust_put_service_token` | Create or replace service token. |
> | `braintrust_put_span_iframe` | Create or replace span iframe. |
> | `braintrust_put_view` | Create or replace view. |
> | `braintrust_update_environment` | Partially update an environment object. |
