Python for AIIntermediate9 August 2026
What is the recommended way to provide an API key to a Python AI application?
Pick an answer to see the explanation.
Answer
Load it from a protected environment variable or secrets manager
API keys should be stored outside source code using protected environment variables or a secrets-management service. Access should be limited to authorised applications and environments. Keys accidentally exposed in code or logs should be revoked and replaced.
Learn more: Explore AI automation with Python →