Learn how to instrument Anthropic Claude API calls in Go using LangWatch.
openai.Client
to point to Anthropic’s API endpoint and use your Anthropic API key.
You will need your Anthropic API key, which you can find in your Anthropic dashboard. Set it as an environment variable:
openai.Client
, configure it with Anthropic’s base URL and your API key. It’s also a best practice to set the gen_ai.system
attribute to "anthropic"
for clear identification in LangWatch.
MaxTokens
parameter to your request, as it is often required by Anthropic.