Anthropic setup
Connect Port to Anthropic's API to use Claude models like claude-sonnet-4-20250514, claude-haiku-4-5-20251001, and claude-opus-4-6. This guide walks you through storing your API key and registering Anthropic as an LLM provider in Port.
Prerequisites
- An active Anthropic account with API access.
- An Anthropic API key. You can generate one in your Anthropic Console.
Step 1: Store your API key in Port secrets
Before configuring the provider, store your Anthropic API key in Port's secrets system.
- In your Port application, click on your profile picture
.
- Click on Credentials.
- Click on the
Secretstab. - Click on
+ Secretand add your secret(s).
For provider-specific secret requirements and examples, see Step 2: Store API Keys in Secrets.
You can choose any names for your secrets. The examples are suggestions. Use names that make sense for your organization, and reference the exact names in your provider configuration.
For more details on managing secrets, see the Port Secrets documentation.
Step 2: Register Anthropic with the Port API
Call the Create or connect an LLM provider API with validate_connection=true to test your configuration. Set provider to "anthropic" and reference the secret name you created in Step 1.
{
"provider": "anthropic",
"enabled": true,
"config": {
"apiKeySecretName": "anthropic-api-key"
}
}
When you register Anthropic without specifying model overrides, Port validates all supported Claude models by default. If you only have access to specific models or want to limit which models are enabled, use the overrides field. See Model overrides for details.
Step 3: Validate the configuration
The validate_connection=true parameter tests your configuration by making a request to your provider. If validation succeeds, your provider configuration is saved. If it fails, check the error message for details.
For more troubleshooting steps, see the Setup & Configuration guide.
Common validation failures:
- Invalid API key: Verify your API key is correct and active in your Anthropic Console.
- Insufficient quota: Ensure your Anthropic account has sufficient usage quota or credits.
- Rate limit exceeded: Wait and retry if you've exceeded Anthropic's rate limits.
After registration
Once your provider is configured:
- Set as default: Go to Builder → Organization Settings → AI tab in the UI, or use the Change default LLM provider and model API to set your provider as the organization's default.
- Use in API calls: Pass the provider name and a supported model name in individual general-purpose AI interactions or invoke a specific agent requests.
For more information on provider selection and validation flow, see Setup & Configuration.