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

# Create a gVault

> Create an app-specific Ground vault.

## 1. Get an API key

Sign in to the [Ground Developer Portal](https://portal.groundtech.co) and
create an API key for your organization. Store the key securely in your backend
and never expose it in your frontend or mobile app.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export GROUND_API_KEY="<your-api-key>"
```

## 2. Create the gVault

Create the gVault from your backend with your Ground API key:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://sandbox.groundtech.co/v2/gvaults \
  -H "Authorization: Bearer $GROUND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "partnerAppId": "your-app-id",
    "vaultId": "ground-ustb-vault",
    "feeRecipientAddress": "0x2222222222222222222222222222222222222222",
    "performanceFeeBps": 2000
  }'
```

`performanceFeeBps` applies only to gains above the vault's high-water mark.
For example, `2000` sends 20% of gains to `feeRecipientAddress`. The management
fee is zero.

The same organization and `partnerAppId` always return the same gVault when the
settings match. A different fee configuration requires a different
`partnerAppId`.

## 3. Wait until it is ready

Poll `GET /v2/gvaults/{gVaultId}` until it returns `status: ready`. Store the
returned `gVaultId` and `contractAddress` in your backend configuration.
