How to add workspace secrets
In the LangSmith UI, ensure that you have an LLM API key set as a workspace secret (either Anthropic or OpenAI API key).- Navigate to Settings and then move to the Secrets tab.
- Select Add secret and enter either
OPENAI_API_KEYorANTHROPIC_API_KEYas the name, and your API key as the value. - Select Save secret.
When adding workspace secrets in the LangSmith UI, make sure the secret keys match the environment variable names expected by your model provider.
Required model key
For Agent Builder to make API calls to LLMs, you need to set an OpenAI or Anthropic API key as a workspace secret. The agent graphs load this key from workspace secrets for inference.Agent Builder supports custom models per agent. See Custom models for more information.
Agent Builder specific secrets
Secrets prefixed withAGENT_BUILDER_ are prioritized over workspace secrets within Agent Builder. This way, you can better track the usage of Agent Builder vs other parts of LangSmith which use the same secrets.
If you have both OPENAI_API_KEY and AGENT_BUILDER_OPENAI_API_KEY, the AGENT_BUILDER_OPENAI_API_KEY secret will be used.
Optional tool keys
Add keys for any tools you enable. These are read from workspace secrets at runtime.EXA_API_KEY: Required for Exa search tools (general web and LinkedIn profile search).TAVILY_API_KEY: Required for Tavily web search.TWITTER_API_KEYandTWITTER_API_KEY_SECRET: Required for Twitter/X read operations (app‑only bearer). Posting/media upload is not enabled.