From aedb10e2f096e1a75eae55319f3afc1d76d8d8a5 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 14:08:02 +0000 Subject: [PATCH] docs: use the shared ANTHROPIC_API_KEY for AI writeback --- agents/set-up-agents.mdx | 2 +- self-host/customize-deployment/environment-variables.mdx | 3 +-- self-host/enterprise-features/ai-writeback.mdx | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/agents/set-up-agents.mdx b/agents/set-up-agents.mdx index 58c8aa15..ad025c2a 100644 --- a/agents/set-up-agents.mdx +++ b/agents/set-up-agents.mdx @@ -129,7 +129,7 @@ The org key is used for chat and agent utility calls only. The following continu - Embeddings - The [evaluation](/agents/create-evaluation-suites) judge -- [AI writeback](/agents/ai-writeback) (configured separately via `AI_WRITEBACK_ANTHROPIC_API_KEY`) +- [AI writeback](/agents/ai-writeback) (uses the instance-wide `ANTHROPIC_API_KEY`) Automatic [issue filing](/agents/issues) is paused while an org has any BYO provider key set, so agent turns never route through the instance provider for issue classification. Remove all BYO keys to re-enable automatic issue filing. diff --git a/self-host/customize-deployment/environment-variables.mdx b/self-host/customize-deployment/environment-variables.mdx index 817d62ed..0a7adc32 100644 --- a/self-host/customize-deployment/environment-variables.mdx +++ b/self-host/customize-deployment/environment-variables.mdx @@ -383,13 +383,12 @@ The AI Analyst supports multiple providers. Provide credentials for the provider | Variable | Description | | ---------------------------- | ------------------------------------------------------------------------------------------- | -| `ANTHROPIC_API_KEY` | (Required when using Anthropic) API key for Anthropic | +| `ANTHROPIC_API_KEY` | (Required when using Anthropic, and for AI writeback) API key for Anthropic | | `ANTHROPIC_MODEL_NAME` | Anthropic model name to use (default=claude-sonnet-4-5) | | `ANTHROPIC_BASE_URL` | Optional HTTP(S) base URL for an Anthropic-compatible gateway. Configure the base before `/v1`; the configured `ANTHROPIC_API_KEY` is sent as a bearer token. | | `ANTHROPIC_AVAILABLE_MODELS` | Comma-separated list of models available in the model picker (default=All supported models) | | `ANTHROPIC_CUSTOM_HEADERS` | JSON object of extra HTTP headers to send with every Anthropic request | | `ANTHROPIC_SUPPORTS_STREAMING` | Set to `false` if your Anthropic endpoint or gateway doesn't support streaming (SSE) completions — Lightdash will make non-streaming requests instead (default=true) | -| `AI_WRITEBACK_ANTHROPIC_API_KEY` | (Required for AI writeback) Dedicated Anthropic API key used by the AI writeback feature. Kept separate from `ANTHROPIC_API_KEY` so writeback and AI Analyst have independent spend caps and fail independently. | #### Azure AI Configuration diff --git a/self-host/enterprise-features/ai-writeback.mdx b/self-host/enterprise-features/ai-writeback.mdx index 48d69306..16349754 100644 --- a/self-host/enterprise-features/ai-writeback.mdx +++ b/self-host/enterprise-features/ai-writeback.mdx @@ -27,7 +27,7 @@ Add the following environment variables to your Lightdash deployment: | Variable | Example | Purpose | | --- | --- | --- | | `E2B_AI_WRITEBACK_TEMPLATE_NAME` | `lightdash/lightdash-ai-writeback` | Lightdash's public E2B template for writeback — pulls our prebuilt sandbox image so you don't have to build one yourself. The `lightdash/` prefix points at our public team template; without it E2B looks in your own team and won't find the image. | -| `AI_WRITEBACK_ANTHROPIC_API_KEY` | `` | Dedicated [Anthropic](https://console.anthropic.com/) API key used by the writeback agent. Kept separate from `ANTHROPIC_API_KEY` so writeback and AI Analyst have independent spend caps and fail independently. | +| `ANTHROPIC_API_KEY` | `` | Your [Anthropic](https://console.anthropic.com/) API key. Used by the writeback agent, the same key [data apps](/self-host/enterprise-features/data-apps) and AI Analyst use. | Restart the backend. Users with AI Analyst access on a project connected to a supported git host will see the agent offer to open a pull request when they ask for a change that belongs in the dbt repo. @@ -54,7 +54,7 @@ Self-hosting AI writeback means you pay your sandbox provider and Anthropic dire - **Your sandbox provider** bills for sandbox runtime. A typical writeback runs for 1–5 minutes while the agent inspects files, edits them, and runs `lightdash compile`. - **Anthropic** bills per token. Each writeback sends the project's dbt catalog and the self-contained instruction generated from the user's request to Claude, plus any files the agent reads while making the change. -Both providers expose usage dashboards. We recommend setting spend limits on both — and using `AI_WRITEBACK_ANTHROPIC_API_KEY` rather than reusing `ANTHROPIC_API_KEY` — so writeback spend can be capped independently of AI Analyst. +Both providers expose usage dashboards. We recommend setting spend limits on both. Writeback shares `ANTHROPIC_API_KEY` with AI Analyst and data apps, so Anthropic spend limits apply across those features. ## Permissions @@ -72,7 +72,7 @@ Check that `LIGHTDASH_LICENSE_KEY` is set and the project's dbt connection is Gi Check your [sandbox provider's](/self-host/customize-deployment/sandboxes) credentials, and verify `E2B_AI_WRITEBACK_TEMPLATE_NAME` is set to `lightdash/lightdash-ai-writeback` (the `lightdash/` prefix is required to pull our public template — a bare name resolves to your own team). If you've overridden `E2B_AI_WRITEBACK_TEMPLATE_TAG`, double-check the tag exists. **Writebacks fail mid-run with an Anthropic error.** -Check your Anthropic account usage limits and confirm `AI_WRITEBACK_ANTHROPIC_API_KEY` is valid. Long-running writebacks can hit rate limits on lower-tier Anthropic plans. +Check your Anthropic account usage limits and confirm `ANTHROPIC_API_KEY` is valid. Long-running writebacks can hit rate limits on lower-tier Anthropic plans. **The agent surfaces a `GitHub App is not installed` or `GitLab App is not installed` error.** Install the Lightdash GitHub App on the repository (from the project's dbt connection settings) or connect the Lightdash GitLab App for your organization, then ask the agent to try again.