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

# Creating Your First API Key

> Set up provider credentials and a project-scoped key step-by-step

This tutorial walks through a complete API key setup flow suitable for production teams.

## What You'll Build

* One provider credential for external model access
* One project-scoped key with expiry and budget controls
* A repeatable process for auditing and lifecycle updates

```mermaid theme={null}
flowchart TD
    A[Select Provider] --> B[Enter Credential Fields]
    B --> C[Create Provider Credential]
    C --> D[Open Projects Tab]
    D --> E[Create Project Key]
    E --> F[Set 30/60-day Expiry]
    F --> G[Set Max Budget]
    G --> H[Review + Manage Key]
```

## Prerequisites

* Access to Bud Admin
* At least one project available in your workspace
* Provider account details ready

## Step 1: Add Provider Credential

1. Open **API Keys** → **Provider**.
2. Click **Add Credentials**.
3. Select a provider and click **Next**.
4. Fill the credential form:
   * API key name
   * Required provider fields
5. Click **Create**.

## Step 2: Validate Provider Credential

1. Click the new credential row.
2. In the drawer, verify:
   * Fields are masked by default
   * Copy action works
   * Deployment usage table is visible for traceability

## Step 3: Create a Project Key

1. Open **Projects** tab.
2. Click **Create New Key**.
3. Fill:
   * **Credential Name**
   * **Project**
   * **Set Expiry** (`30 days` or `60 days`)
   * **Set Max Budget**
4. Click **Create**.

## Step 4: Review Key Details

1. Open the new project key row.
2. Confirm key metadata:
   * Project name
   * Expiry date
   * Last used value
   * Max budget
3. Test visibility toggle and copy action.

## Step 5: Perform a Lifecycle Update

1. Use the action menu in the drawer.
2. Click **Edit**.
3. Update expiry and/or max budget.
4. Save and verify the updated values in the list.

## Step 6: Test Deletion Safety

1. From the drawer action menu, choose **Delete**.
2. Verify confirmation dialog appears.
3. Cancel first to validate safety behavior.
4. Proceed only when you are rotating or decommissioning.

## Best Practices Applied

<Check>Provider credentials and project keys are separated by purpose.</Check>
<Check>Expiry and budget are configured at creation time.</Check>
<Check>Secrets are revealed only when needed.</Check>
<Check>Edit/delete flows are confirmation-protected.</Check>
