Tutorials Providers and Models Lab

Provider Config Design

Beginner AI Evaluated
Context
AI Hub never stores actual API keys in the database. Instead, `api_key_env_var` holds the ENVIRONMENT VARIABLE NAME — for example 'ANTHROPIC_API_KEY'. At runtime, the system calls `os.environ.get('ANTHROPIC_API_KEY')` to read the actual key. The key itself lives only in the `.env` file (which is gitignored) and in the production environment's secrets manager.

Your Challenge

A team wants to use AI Hub with the Anthropic Claude API. They don't want API keys visible in source code or the database. Describe how you would configure the ProviderConfig in AI Hub Admin: which fields you would fill in, what value goes in `api_key_env_var`, and why the system is designed to store the key this way.
Need a hint?

Think about what the `.env` file is for and why it's listed in `.gitignore`. The field stores a *name*, not a *value*.

Log in to submit your answer and receive AI feedback.

← Back to Module Next Exercise →