Skip to main content

Module env_api_keys

Module env_api_keys 

Source
Expand description

Environment variable-based API key resolution (LAST RESORT)

Provides environment variable detection as a last-resort fallback for CI/CD, containers, and other automated environments.

For local development, credentials should be stored via oxicode setup in ~/.config/oxicode/auth.json. This file-based approach is more reliable than environment variables, which are lost when the shell restarts.

Auth priority (see provider_registry.rs):

  1. Runtime override (–api-key)
  2. Stored credential (auth.json)
  3. OAuth token
  4. Ambient credentials (AWS IAM, Google ADC)
  5. Environment variable ← this module

Functions§

find_env_keys
Get environment variables that can provide an API key for a provider
get_all_env_keys
Get all providers with environment variable credentials
get_env_api_key
Get API key from environment variables for a provider
get_oauth_env_token
Get OAuth token from environment (for providers that support it)
has_bedrock_creds
Check Amazon Bedrock ambient credentials
has_bedrock_creds_full
Check if Bedrock has full credential configuration
has_env_key
Check if any environment variable is set for a provider
has_vertex_adc
Check Vertex AI-specific ambient credentials
has_vertex_adc_full
Check if Vertex AI has all required components for ADC authentication
supports_oauth_env
Check if a provider supports OAuth tokens via environment