# API use

**URL:** https://community.mindstudio.ai/t/api-use/66
**Category:** MindStudio IDE
**Created:** [March 20, 2025, 7:59pm UTC](https://community.mindstudio.ai/t/api-use/66 "2025-03-20T19:59:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cozy](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/cozy/32/34_2.png) [@cozy](https://community.mindstudio.ai/u/cozy)
#### Post date: [March 20, 2025, 7:59pm UTC](https://community.mindstudio.ai/t/api-use/66/1 "2025-03-20T19:59:12Z")

</div>

Hi all,

Could anyone help me with where I should store my `.env` files in Mindstudio for secure API key management? Also, is using `global.api_key` recommended, or is there a better approach for handling sensitive credentials?

---

<div class="post-metadata">

### Author: ![sean](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sean](https://community.mindstudio.ai/u/sean)
#### Post date: [March 20, 2025, 9:21pm UTC](https://community.mindstudio.ai/t/api-use/66/2 "2025-03-20T21:21:11Z")

</div>

You can use the `secret` configuration item type for API keys in MindStudio function. Try remixing this demo agent: [https://app.mindstudio.ai/agents/copy-of-demo-secret-key-fcfb7dfb/remix](https://app.mindstudio.ai/agents/copy-of-demo-secret-key-fcfb7dfb/remix) and take a look at the Configuration tab for the function. Let me know if that helps!

---

<div class="post-metadata">

### Author: ![cozy](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/cozy/32/34_2.png) [@cozy](https://community.mindstudio.ai/u/cozy)
#### Post date: [March 21, 2025, 5:21pm UTC](https://community.mindstudio.ai/t/api-use/66/3 "2025-03-21T17:21:09Z")

</div>

Thanks so much, Sean!

---

<div class="post-metadata">

### Author: ![Alex\_MindStudio](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/alex_mindstudio/32/27_2.png) [@Alex\_MindStudio](https://community.mindstudio.ai/u/Alex_MindStudio)
#### Post date: [April 4, 2025, 3:35pm UTC](https://community.mindstudio.ai/t/api-use/66/4 "2025-04-04T15:35:06Z")

</div>


