Skip to main content
Version: 1.0

aixplain.utils.config

Copyright 2022 The aiXplain SDK authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

validate_api_keys

def validate_api_keys()

[view_source]

Centralized API key validation function - single source of truth.

This function handles all API key validation logic:

  1. Ensures at least one API key is provided
  2. Prevents conflicting API keys
  3. Auto-normalizes AIXPLAIN_API_KEY to TEAM_API_KEY if needed

Raises:

  • Exception - If no API keys are provided or if conflicting keys are detected

check_api_keys_available

def check_api_keys_available()

[view_source]

Runtime check to ensure API keys are available.

This is used by decorators and other runtime validation. Uses the same validation logic as the module-level check.

Raises:

  • Exception - If no valid API keys are available