# API Key Setup

## What is an API key and why do I need it?

An **API key** is a unique string of characters that identifies your app to an external AI service like OpenAI, Gemini, or ElevenLabs. It works like a secure password that allows your app to access models for text generation, image creation, speech synthesis, and more.

Without an API key, the AI Dev Kit cannot communicate with the AI provider — it's required for all runtime requests.

***

## How do I get my API key?

See each provider section under **Provider Setup** for step-by-step instructions.

[OpenAI](/ai-dev-kit/getting-started/api-key-setup/how-to-get-api-keys/openai.md)

[Google Gemini](/ai-dev-kit/getting-started/api-key-setup/how-to-get-api-keys/google-gemini.md)

[ElevenLabs](/ai-dev-kit/getting-started/api-key-setup/how-to-get-api-keys/elevenlabs.md)

[OpenRouter](/ai-dev-kit/getting-started/api-key-setup/how-to-get-api-keys/openrouter.md)

***

## Where do I paste my API key in Unity?

{% hint style="info" %}
Go to **Edit > Preferences > AI Dev Kit > \[Each Provider Tab]**\
then paste your API key into the \[API key] field.
{% endhint %}

<figure><img src="/files/ELlrI2PgzszWGPgz4m4E" alt=""><figcaption></figcaption></figure>

***

## Can I use the same API key for multiple projects?

Yes.

Most providers — including OpenAI — allow you to reuse a single API key across multiple projects.\
However, keep in mind that all usage will count toward the same billing account and rate limits.\
If you're working on separate commercial products, it's a good idea to generate and track separate keys.

***

## Is my API key safe in a Unity project?

Yes.

**AI Dev Kit** supports **API Key Encryption (AES)** through the **Preferences window** under each provider tab.

{% hint style="info" %}
Go to **Edit > Preferences > AI Dev Kit > \[Each Provider Tab]**\
then press the little key button on the right side of your API key.
{% endhint %}

<figure><img src="/files/JVh3k2qw1wyRVtjL4fIX" alt=""><figcaption></figcaption></figure>

***

## What happens if I lose my API key?

If you lose your API key, you won’t be able to authenticate requests to the AI provider.\
Most providers (like OpenAI) allow you to regenerate a new key from your account dashboard.\
**You cannot recover the original key once it's lost**, so make sure to store it in a password manager or reissue it when needed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://glitch9.gitbook.io/ai-dev-kit/getting-started/api-key-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
