# Configure a Repository

After creation, repository configuration is where you manage the repository lifecycle: resources, endpoint behavior, and API keys.

{% hint style="info" %}
You can open repository details from both **Overview** and **Inventory** in **Cloud and AI Gateway** → **Repositories**.
{% endhint %}

## What you can configure

In a repository detail page, you usually have two operational sections:

1. **Resources**
   * View currently attached resources.
   * Use **Add** to attach existing resources or create new ones from inside the repository flow (depending on enabled providers/features).
   * Supported resource families can include Cloud Storage, AI LLM, and Packets.
2. **API Keys**
   * Generate and manage repository API keys used by applications and SDKs.

## Configure resources

{% hint style="danger" %}
Resource collision rules still apply during configuration updates:

* **S3 & GCS**: bucket names must be unique across providers within one repository.
* **Azure Blob**: storage account names must not collide with S3/GCS bucket identifiers in that same repository.
* You can attach multiple Azure containers from the same storage account, as long as global repository namespace collisions are avoided.
  {% endhint %}

{% stepper %}
{% step %}

#### Open repository details

From **Overview** or **Inventory**, click a repository name/card to open its details.
{% endstep %}

{% step %}

#### Review current resources and endpoint context

In the resources area, review:

* attached resource list,
* selected API endpoint type,
* SDK/protocol context exposed by this repository.
  {% endstep %}

{% step %}

#### Add resources

Click **Add** in the resources section, then choose to attach:

* storage resources,
* AI LLM resources,
* other supported resource types in your workspace.

If needed, you may also create new resources from this flow, then attach them immediately.
{% endstep %}

{% step %}

#### Save changes and validate

Save the configuration and verify resource visibility in the repository detail page.
{% endstep %}
{% endstepper %}

## Generate and manage API keys (in configuration)

API key generation belongs to repository configuration (not repository creation).

Each repository key is scoped to the repository and to an endpoint compatibility model. A key grants access according to its access mode to the compatible resources currently attached to that repository.

You can generate repository API keys with **two valid UI paths**:

1. **Centralized path**: open **Repositories** → **API Keys** from the left menu, then add/manage keys across repositories from one page.
2. **Repository detail path**: open one repository from **Overview** or **Inventory**, scroll to the **API Keys** table in repository details, then click **Add**.

{% hint style="info" %}
Use the centralized page for fleet operations (multi-repository), and the repository detail table for contextual operations right after creating/configuring a specific repository.
{% endhint %}

### Option 1 — Generate keys from the centralized **Repositories → API Keys** page

{% stepper %}
{% step %}

#### Open the centralized API Keys page

In the left menu, open **Cloud and AI Gateway** → **Repositories** → **API Keys**.
{% endstep %}

{% step %}

#### Click Add and select repository/type

Click **Add** (or **Add API Key**) and choose:

* target **Repository**,
* key family / endpoint compatibility (**Storage** or **AI LLM** according to your use case),
* **Description**,
* **Access mode** (READ / WRITE / READ-WRITE / provider-dependent options).
  {% endstep %}

{% step %}

#### Save and copy secret immediately

Create the key, then copy the secret immediately and store it in your secret manager.
{% endstep %}
{% endstepper %}

### Option 2 — Generate keys from the repository detail **API Keys table**

{% stepper %}
{% step %}

#### Open repository details

From **Overview** or **Inventory**, open the target repository.
{% endstep %}

{% step %}

#### Find the API Keys table

In repository details, scroll to the **API Keys** table section (inside the repository detail page).
{% endstep %}

{% step %}

#### Click Add in the API Keys table

Click **Add** and create either:

* a **Storage API key** (for S3/GCS/Azure Blob-compatible repository usage), or
* an **AI LLM API key** (for OpenAI-compatible repository usage).

Then define description and access mode according to your policy.
{% endstep %}

{% step %}

#### Save and copy secret immediately

After creation, copy the generated secret and store it in your secret manager.

{% hint style="danger" %}
The full secret is displayed only once at creation time. If lost, generate a new key and rotate credentials in all clients.
{% endhint %}
{% endstep %}

{% step %}

#### Maintain keys safely

For each key, you can later:

* update description,
* adjust access mode (when allowed),
* revoke/delete the key.

Use least-privilege and periodic rotation.
{% endstep %}
{% endstepper %}

### Endpoint compatibility reminder

| Cloud Storage endpoint types | AI endpoint types              |
| ---------------------------- | ------------------------------ |
| **S3**                       | **OPENAI** (OpenAI-compatible) |
| **GCS**                      |                                |
| **AZURE BLOB**               |                                |

Key display formats can differ by endpoint type. For example, storage-oriented key IDs and secrets may be shown differently from AI-oriented credentials. Always copy and store credential values at creation time.

## Security notes

* Secrets are sensitive credentials and should be stored only in secured secret managers.
* Avoid sharing keys between teams/services; create dedicated keys per workload.
* Rotate and revoke keys during incident response or role changes.
* See [Security and Secret Encryption](https://docs.flashback.tech/support-reference/security-and-secret-encryption) for platform-level handling principles.

{% hint style="danger" %}
You cannot recover a previously displayed repository API secret from the UI after creation. Plan credential rotation workflows in advance and document ownership for every key.
{% endhint %}

## Related API references

* [Repo API Keys (Storage)](https://docs.flashback.tech/support-reference/platform-api-reference/storage-apis/api_keys)
* [AI API Keys](https://docs.flashback.tech/support-reference/platform-api-reference/ai-apis/ai-api-keys)
* [Repository Management APIs](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management)
