# Repeated build fails how to get API keys added to netlify

**URL:** <https://answers.netlify.com/t/repeated-build-fails-how-to-get-api-keys-added-to-netlify/6128>\
**Category:** Support\
**Tags:** environment-vars, gatsby\
**Created:** [December 11, 2019, 9:10pm UTC](https://answers.netlify.com/t/repeated-build-fails-how-to-get-api-keys-added-to-netlify/6128 "2019-12-11T21:10:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [December 15, 2019, 7:34pm UTC](https://answers.netlify.com/t/repeated-build-fails-how-to-get-api-keys-added-to-netlify/6128/2 "2019-12-15T19:34:42Z")

</div>

Have you seen this article? Setting the variables is not enough; you must also interpolate them in your files during build:

> [@\[Support Guide\] Using environment variables on Netlify correctly](https://answers.netlify.com/t/common-issue-using-environment-variables-on-netlify-correctly/267):
>
> Last reviewed: August 2023 The preferred way to use environment variables in Netlify is to set them in our environment - be that in the Environment Variables settings UI (on the site’s “Build & Deploy settings” page), or [via netlify.toml](https://docs.netlify.com/configure-builds/file-based-configuration/). You’ll want to choose the right pattern to meet your needs. Setting variables in our UI may be considered a bit more secure, since only people with access to the Netlify admin UI for your site can see them, rather than “anyone who can clone your repo!”. Thes…

---

_[View the full topic](https://answers.netlify.com/t/repeated-build-fails-how-to-get-api-keys-added-to-netlify/6128)._
