> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leaf7.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get up and running with the Leaf7 API in under 5 minutes.

# Quickstart

This guide walks you through creating a project, generating keys, and distributing them — all via the API.

## Step 1: Get your API key

Log in to [leaf7.fun/dashboard](https://leaf7.fun/dashboard), go to **Settings**, and copy your API key.

## Step 2: Create a project

<CodeGroup>
  ```bash bash theme={null}
  curl -X POST https://api.leaf7.fun/api/vendor/projects/ \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "My Script Hub",
      "description": "Premium Roblox script",
      "ffa_active": false,
      "notify_enabled": true,
      "silent_mode": false
    }'
  ```

  ```cmd cmd  theme={null}
  curl -X POST "https://api.leaf7.fun/api/vendor/projects/" ^
    -H "Authorization: Bearer YOUR_API_KEY" ^
    -H "Content-Type: application/json" ^
    -d "{\"name\": \"My Script Hub\", \"description\": \"Premium Roblox script\", \"ffa_active\": true, \"notify_enabled\": true, \"silent_mode\": false}"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
    "project_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "My Script Hub",
    "ffa_active": true,
    "is_active": true,
    "version": "0.0.0"
}
```

<Tip>
  Save the `project_id` — you'll need it for all key management operations.
</Tip>

## Step 3: Upload your script

```bash theme={null}
curl -X PUT https://api.leaf7.fun/api/vendor/projects/PROJECT_ID/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "encrypted_source": "print(\"Hello from Leaf7!\")\nprint(L7_LinkedDiscordID)\nprint(L7_ScriptName)"
  }'
```

<Note>
  The `encrypted_source` field accepts **raw Lua source code**. Leaf7 handles encryption, obfuscation, and VM protection automatically on the server side.
</Note>

## Step 4: Generate buyer keys

```bash theme={null}
curl -X POST https://api.leaf7.fun/api/vendor/keys/buyer/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "PROJECT_ID",
    "amount": 5,
    "key_days": 30
  }'
```

**Response:**

```json theme={null}
[
    { "key_id": "abc123...", "project_id": "...", "redeemed": false, "key_days": 30 },
    { "key_id": "def456...", "project_id": "...", "redeemed": false, "key_days": 30 }
]
```

## Step 5: Share the loadstring

Your users execute your script using the Leaf7 loadstring. They set their key at the top:

```lua theme={null}
script_key = "abc123..."
loadstring(game:HttpGet("https://api.leaf7.fun/loader/PROJECT_ID"))()
```

That's it! Leaf7 handles authentication, HWID locking, obfuscation, and delivery automatically.

## What's next?

<CardGroup cols={2}>
  <Card title="Key Management" icon="key" href="/api-reference/keys">
    Ban, unban, reset HWID, and manage active keys.
  </Card>

  <Card title="Script Macros" icon="code" href="/integration/macros">
    Use L7 macros like L7\_LinkedDiscordID in your scripts.
  </Card>
</CardGroup>
