MCPcopy Create free account
hub / github.com/RightNow-AI/rightnow-cli / get_api_key

Method get_api_key

rightnow_cli/cache.py:90–97  ·  view source on GitHub ↗

Get the stored API key if it's valid (not a placeholder).

(self)

Source from the content-addressed store, hash-verified

88 return bool(api_key) and api_key != "sk-temp-placeholder"
89
90 def get_api_key(self) -> Optional[str]:
91 """Get the stored API key if it's valid (not a placeholder)."""
92 config = self.get_config()
93 api_key = config.get('openrouter_api_key')
94 # Return None if it's the placeholder value
95 if api_key == "sk-temp-placeholder":
96 return None
97 return api_key
98
99 def save_api_key(self, api_key: str):
100 """Save API key to config (prevents saving placeholder keys)."""

Callers 7

_run_optimizationMethod · 0.80
handle_commandFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
test_get_api_key_noneMethod · 0.80

Calls 2

get_configMethod · 0.95
getMethod · 0.45

Tested by 2

test_get_api_key_noneMethod · 0.64