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

# Onboarding

> Set up your account, team and project, then create and manage the API key that authenticates requests to the Earn, Trade and Borrow APIs.

Every integration with Yield.xyz is organized around a **team and its projects**. A team manages users and access, and each project holds its enabled products and opportunities, fee configuration and the API keys used to authenticate requests. You manage all of it in the [dashboard](https://dashboard.yield.xyz).

## Account and team

Sign in or create an account at [dashboard.yield.xyz](https://dashboard.yield.xyz), then complete the initial team setup. If your organization uses single sign-on (SSO), you can sign in through your identity provider. To invite teammates and set their roles, see [Roles & permissions](/documentation/advanced-setup/roles-permissions.md).

## Projects

A project is the unit of configuration for an integration or business line. Each project has its own:

* **Enabled products and opportunities**: Configure access to Earn, Trade, and Borrow directly from the dashboard. For Earn, a project's keys can only discover and act on enabled yields. `GET /v1/yields` returns only enabled yields, so a project with nothing enabled returns an empty list. Calling an action on a yield that isn't enabled returns `400 Bad Request` with `"Yield \"<id>\" is not enabled for this project"`.
* **Fee configuration**: Configure supported fees for Earn, Trade, and Borrow at the project level through the dashboard. Available fee models depend on the product and integration. For Earn, deposit, performance, and management fees on supported yields can also be managed through [Programmatic access](/documentation/advanced-setup/programmatic-access.md).
* **API keys**: Each project can have multiple API keys for authenticating requests across the supported APIs.

Start with one project per integration. You can create additional projects to separate applications, environments, or white-label clients that require different products, opportunities, fee configurations, or credentials.

## API keys

An API key authenticates requests to the Earn, Trade, and Borrow APIs on behalf of its project. The key is associated with that project's configuration, including enabled products, opportunities, and applicable fee settings.

**1. Create a project**

Sign in to the [dashboard](https://dashboard.yield.xyz) and create a project if you don't already have one.

**2. Generate a key**

Open the project and create an API key. Give it a name; a note and an expiration date are optional. If you don't set an expiration date, the dashboard applies a default.

**3. Copy the key**

The key value is displayed at creation. Copy it before leaving the page.

> [!WARNING]
>
> Copy your key immediately after creation. If you lose it, generate a new one; there's no way to retrieve the original value later.

### Authenticating requests

All three APIs use the `x-api-key` header for authentication. Include your project API key with every request.

The example below uses the Earn API:

```bash cURL theme={null}
curl https://api.yield.xyz/v1/yields \
  -H "x-api-key: $YIELD_API_KEY"
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.yield.xyz/v1/yields", {
  headers: { "x-api-key": process.env.YIELD_API_KEY },
});
```

A missing or invalid key returns `401 Unauthorized`. See [Authentication](/api-reference/authentication.md) for the full request and error reference.

### Base URLs

Each API has its own base URL, with endpoints under the `/v1` prefix.

| API | Base URL |
| - | - |
| **Earn API** | `https://api.yield.xyz/v1` |
| **Perps API** (Trade) | `https://perps.yield.xyz/v1` |
| **Borrow API** | `https://borrow.yield.xyz/v1` |

The same project API key can be used across all three APIs, with access determined by the products and opportunities configured for your project. The Trade API, coming soon, will be served at `https://trade.yield.xyz/v1` and accepts the same key.

See [Base URLs](/api-reference/base-urls.md) for the full endpoint reference.

## Managing keys

From the project page, you can:

| Action | Effect |
| - | - |
| Edit | Change a key's name, note, or expiration date |
| Rotate | Generate a replacement key without a separate deletion step. The old key keeps working for 24 hours, so you can switch over |
| Delete | Revoke the key immediately. Any integration still using it loses access. |

> [!WARNING]
>
> Deleting a key revokes access for any integration currently using it, with no undo. Rotate a key before removing it if you need continuity while you update your integration.

A key with an expiration date shows as **Expires soon** in the dashboard within 7 days of expiring, and keeps working for one calendar month after its expiry date before it stops working. Rotate a key before it expires to avoid an interruption.

> [!NOTE]
>
> Enterprise teams that need to manage projects outside the dashboard can read [Programmatic access](/documentation/advanced-setup/programmatic-access.md).

## Securing your keys

> **Server-side only**
>
> Make API calls from your backend. Never embed a key in client-side code or a mobile app bundle.

> **Environment variables**
>
> Store keys as environment variables or in a secrets manager, not in source control.

> **Rotate on a schedule**
>
> Rotate keys periodically and immediately if you suspect a key was exposed.

> **One key per deployment**
>
> Give each service or deployment its own key so you can revoke one without affecting the others.

## Next steps

> **[Quickstart](/documentation/get-started/quickstart.md)**
>
> Use your API key to make your first Earn, Trade, or Borrow API request.

> **[Authentication](/api-reference/authentication.md)**
>
> Authentication requirements and error responses across the APIs.

> **[Dashboard configuration](/documentation/advanced-setup/dashboard/index.md)**
>
> Payout wallets, yield enablement, custom RPCs, geo-blocking and other project settings.

> **[Roles & permissions](/documentation/advanced-setup/roles-permissions.md)**
>
> Control which teammates can create or manage keys.

> **[Rate limits](/documentation/plans-limits/rate-limits.md)**
>
> Understand request limits by plan.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.