# Authenticating with Your API Key

To use the Giftoin API, you need to authenticate using your API key. We've simplified this process by using a settings file within the GiftoinModule.

#### Steps to Set Up Authentication

1. **Locate the Settings File**: In the GiftoinModule folder, you'll find a file named `Settings.lua`.
2. **Enter Your API Key**: Open `Settings.lua` and look for the `API_KEY` variable. Replace the placeholder value with your actual API key:

   ```lua
   -- GiftoinSettings.lua
   local Settings = {
       API_KEY = nil -- Replace with your actual API key
   }

   return Settings
   ```
3. **Save the File**: After entering your API key, save the `Settings.lua` file.

#### Using the API

With your API key set in the settings file, the Giftoin Module will automatically handle authentication for all API calls. You don't need to manually authenticate in your scripts.

To use the Giftoin API in your game scripts, simply require the module as usual:

```lua
local GiftoinApi = require(game.ReplicatedStorage.GiftoinModule.API)
local GiftoinUtils = require(game.ReplicatedStorage.GiftoinModule.Utils)
local GiftoinEvents = require(game.ReplicatedStorage.GiftoinModule.Events)


local claimGiftoinEvent = game.ReplicatedStorage.GiftoinModule.ClaimGiftoinEvent

claimGiftoinEvent.OnServerEvent:Connect(function(player)
-- Now you can use GiftoinAPI functions without additional authentication steps
	GiftoinApi.someFunction(player)
end)
```

#### Security Note

Remember to keep your `GiftoinSettings.lua` file secure and never share it publicly.\
If you're using version control, make sure to add this file to your `.gitignore` to prevent accidentally committing your API key.


---

# 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://docs.giftoin.org/platform-guides/roblox/authenticating-with-your-api-key.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.
