jostlebot Claude Opus 4.5 commited on
Commit
0cf629c
·
1 Parent(s): 7c399a2

Add debug info for API key troubleshooting

Browse files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -557,9 +557,11 @@ def get_client():
557
  os.environ.get("anthropic_api_key")
558
  )
559
  if not api_key:
 
 
560
  raise ValueError(
561
- "Anthropic API key not found. Please add a secret in Space Settings > Repository secrets. "
562
- "Try naming it: ANTHROPIC_API_KEY"
563
  )
564
  return anthropic.Anthropic(api_key=api_key)
565
 
 
557
  os.environ.get("anthropic_api_key")
558
  )
559
  if not api_key:
560
+ # Debug: show env vars that contain 'key' or 'api' (names only)
561
+ relevant_vars = [k for k in os.environ.keys() if 'key' in k.lower() or 'api' in k.lower() or 'anthropic' in k.lower()]
562
  raise ValueError(
563
+ f"Anthropic API key not found. Available relevant env vars: {relevant_vars}. "
564
+ "Please add a secret named ANTHROPIC_API_KEY in Space Settings > Repository secrets."
565
  )
566
  return anthropic.Anthropic(api_key=api_key)
567