Skip to content

feat: add Anthropic API base URL configuration support#1

Merged
rkuprin merged 3 commits intomainfrom
custom-base-url
Jan 9, 2026
Merged

feat: add Anthropic API base URL configuration support#1
rkuprin merged 3 commits intomainfrom
custom-base-url

Conversation

@rkuprin
Copy link
Owner

@rkuprin rkuprin commented Jan 8, 2026

Summary

This PR adds support for configuring custom Anthropic API base URLs, enabling users to work with enterprise deployments or custom endpoints alongside the standard Anthropic API.

Changes Made

Core Features

  • Base URL Configuration: Added optional base URL field to Anthropic API key setup
  • Unified UI: Combined API key and base URL inputs into one cohesive configuration section
  • Environment Support: Added ANTHROPIC_BASE_URL environment variable support for the Claude SDK
  • Persistent Storage: Base URLs are stored alongside API keys in the credentials system

Technical Implementation

  • Enhanced Credentials interface with optional baseUrls field
  • Updated SettingsService for base URL persistence and retrieval
  • Modified Claude provider to pass ANTHROPIC_BASE_URL to the SDK
  • Updated setup API routes to handle base URL parameters
  • Enhanced UI components with clean, user-friendly base URL input

User Experience

  • Backward Compatible: Existing users are unaffected; base URL field is optional
  • Intuitive Design: API key and base URL are grouped together as related settings
  • Clear Labeling: Helpful placeholder text guides users on when to use custom base URLs
  • Single Action: One "Save Configuration" button saves both values together

Use Cases

This feature enables:

  • Enterprise Deployments: Organizations with custom Anthropic API endpoints
  • Development Environments: Using staging or development API instances
  • Self-Hosted Solutions: Custom API gateway configurations
  • Regional Deployments: API endpoints in specific geographic regions

Testing

  • ✅ All TypeScript compilation passes
  • ✅ Build process completes successfully
  • ✅ UI builds without errors
  • ✅ Package dependencies resolved correctly

Migration Notes

  • No migration required - feature is opt-in
  • Existing API key configurations continue to work unchanged
  • Default behavior unchanged when base URL is not specified

- Added support for configuring custom Anthropic API base URLs to enable enterprise deployments and custom endpoints.
- Enhanced the Credentials interface to include optional baseUrls field for storing custom API endpoints.
- Updated the Claude provider to support ANTHROPIC_BASE_URL environment variable for the Anthropic SDK.
- Modified the SettingsService to handle base URLs alongside API keys with proper persistence.
- Updated setup API routes to accept and store base URL configuration from the UI.
- Combined API key and base URL inputs into a single cohesive configuration section in the setup UI.
- Enhanced the HTTP client and Electron API to pass base URL parameters through the save flow.
- Updated all type definitions to ensure type safety for the new base URL functionality.

This allows users to configure custom Anthropic API endpoints while maintaining backward compatibility for existing users who don't need this feature.

Closes AutoMaker-Org#378
…nment variables

- Updated the verification handler to clear both the API key and base URL when using CLI authentication.
- Restored the original base URL after verification, ensuring proper environment management for different authentication methods.
- Improved logging to reflect changes in environment variable handling during CLI verification.
- Added a function to build an environment object containing explicitly allowed environment variables for the SDK.
- This ensures that only specified variables are passed to the SDK, enhancing security and control over the environment.
- Updated the verification handler to utilize the new environment management function during authentication.
@rkuprin rkuprin merged commit 77cf672 into main Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant