Skip to content

feat(api): make Client support optional API key and custom base URL#7

Merged
KellyJDavis merged 1 commit into
mainfrom
add-client
Nov 28, 2025
Merged

feat(api): make Client support optional API key and custom base URL#7
KellyJDavis merged 1 commit into
mainfrom
add-client

Conversation

@KellyJDavis

Copy link
Copy Markdown
Owner

Allow the Client class to be initialized with flexible authentication and base URL configurations:

  1. API key only: Uses default production API base URL with authentication
  2. Base URL only: Uses custom base URL without authentication (for local servers)
  3. Both: Uses custom base URL with authentication

This enables the client to work with:

  • Production API (requires API key)
  • Local HTTP servers (no authentication required)
  • Custom API backends (with or without authentication)

The api_key parameter is now optional, and a new base_url parameter has been added. Headers are conditionally set based on whether an API key is provided. Existing code using Client(api_key="...") remains fully compatible.

Allow the Client class to be initialized with flexible authentication
and base URL configurations:

1. API key only: Uses default production API base URL with authentication
2. Base URL only: Uses custom base URL without authentication (for local servers)
3. Both: Uses custom base URL with authentication

This enables the client to work with:
- Production API (requires API key)
- Local HTTP servers (no authentication required)
- Custom API backends (with or without authentication)

The api_key parameter is now optional, and a new base_url parameter
has been added. Headers are conditionally set based on whether an
API key is provided. Existing code using Client(api_key="...") remains
fully compatible.
@KellyJDavis KellyJDavis merged commit 8710c70 into main Nov 28, 2025
@KellyJDavis KellyJDavis deleted the add-client branch November 28, 2025 12:19
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