All Posts

How to Add API Keys (OpenAI, Claude, and More)

Securely add API keys like OPENAI_API_KEY or CLAUDE_API_KEY to your app, and learn how to keep secret keys safe.

SNAPP TeamJune 24, 20263 min read36 views

How to Add API Keys (OpenAI, Claude, and More)

Building an AI feature, a maps screen, or anything that talks to an outside service? Those services need an API key — a secret token that authorizes your app to use them. Snapp gives you a simple, secure place to store keys like OPENAI_API_KEY or CLAUDE_API_KEY, and then uses them in your app automatically.

Here's how.

---

Step by step

1. Get your key from the provider, for example:

- OpenAI → platform.openai.com/api-keys (sk-proj-...)

- Anthropic / Claude → console.anthropic.com (sk-ant-...)

2. Open your app in the builder.

3. Click the Settings (gear) icon, then open the Environment panel.

4. Click Add Environment Key.

5. Fill in the form:

- Key Name — use uppercase with underscores, e.g. OPENAI_API_KEY

- Key Value — paste your key

- Service Name (optional) — e.g. OpenAI

- Description (optional) — a note to your future self

6. Save.

Your key is encrypted and stored against your app. Now ask the AI to use it, for example: "Use my OpenAI key to summarize the user's notes."

---

Naming your keys

Key names must use uppercase letters, numbers, and underscores only. Snapp auto-formats them for you, so openai api key becomes OPENAI_API_KEY.

Common keys:

  • OPENAI_API_KEY — OpenAI / GPT models
  • CLAUDE_API_KEY — Anthropic / Claude models
  • GOOGLE_MAPS_KEY — Google Maps
  • …or any custom key your chosen service needs
  • ---

    Will my API keys be exposed?

    No — not on the web and not on mobile. Your secret keys are protected by Snapp Vault. They're stored encrypted on our servers and never go inside your app or your website. When your app calls an outside service like OpenAI, Claude or Stripe, Snapp adds the key on our side, so nobody who downloads your app or visits your site can dig it out. You don't have to wire any of this up by hand: just tell the AI what you want, e.g. "Use my OpenAI key to summarize the user's notes," and it uses the secure path automatically.

    Keys that are designed to be public, like a domain-restricted Google Maps key, stay in the app as they're meant to.

    Best practices

  • Set spending limits in your provider's dashboard. It's the most reliable safety net against a surprise bill.
  • Prefer restricted keys where the provider offers them, for example a Google Maps key limited to your app or domain.
  • If you ever paste a key somewhere public by mistake, revoke it in the provider's dashboard, create a new one, and update it in Settings → Environment.
  • ---

    Common questions

    Where do I find my key again later? Settings → Environment → Your Keys. You can update or delete any key there.

    Can I add more than one provider? Yes — add as many keys as you need.

    My API calls fail with an auth error. Re-check the key value (no extra spaces) and confirm the key is active and funded in the provider's dashboard.

    ---

    What's next

  • Learn how Snapp Vault protects your keys.
  • Connect Supabase to give your app a real database.
  • Share your app once your AI feature works.
Share:

SNAPP Team

Articles and content from the SNAPP team

Related Posts

Build Your Own App with SNAPP

Develop mobile apps with AI, no coding required

Start Free