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

# API Keys

> Authenticate your endpoint to Iroh Services to push metrics and connectivity reports

API keys authenticate your endpoint to Iroh Services. Iroh itself is permissionless (connections between endpoints don't need authorization), so API keys only come into play when an endpoint pushes data into your project.

## What API keys authorize

API keys are required for:

* Uploading metrics from endpoints to your project
* Sending network diagnostics reports from endpoints to your project

API keys are **not** required for:

* Synchronizing data across relays
* [NAT traversal](/concepts/nat-traversal) connections to other iroh endpoints

## Get an API key

After signing in, [create a new project](https://services.iroh.computer/projects/projects/new?utm_source=docs\&utm_content=quickstart). This is your sandbox for all endpoints, the control center where you manage relays, metrics, and networks.

[<img src="https://mintcdn.com/number0/NHEZN6zQYHtc1nNL/images/new-project.png?fit=max&auto=format&n=NHEZN6zQYHtc1nNL&q=85&s=2ff81383e3198f2f23fb07175ad390d9" alt="Create Project" width="644" height="400" data-path="images/new-project.png" />](https://services.iroh.computer/projects/projects/new?utm_source=docs\&utm_content=quickstart)

Then navigate to your project's **Settings → API Keys** tab and click **Create API Key**. The key is shown once on creation, so copy it somewhere safe.

<img src="https://mintcdn.com/number0/NHEZN6zQYHtc1nNL/images/create-api-key.png?fit=max&auto=format&n=NHEZN6zQYHtc1nNL&q=85&s=b1dc7bfecd43fb216598b0e6c1d451e5" alt="Create API Key" width="1284" height="421" data-path="images/create-api-key.png" />

<img src="https://mintcdn.com/number0/NHEZN6zQYHtc1nNL/images/see-api-key.png?fit=max&auto=format&n=NHEZN6zQYHtc1nNL&q=85&s=a3f473fad9a35d9af65c7f192ec24793" alt="See API Key" width="1019" height="199" data-path="images/see-api-key.png" />

The environment variable used by the Rust client is `IROH_SERVICES_API_SECRET` (named for legacy reasons; same thing as your API key).

## Use it in your app

Pass the key when building your `iroh_services::Client`:

```rust theme={null}
use iroh_services::Client;

let client = Client::builder(&endpoint)
    .api_secret_from_str("YOUR_API_KEY")?
    .build()
    .await?;
```

In production, load the key from a config file or environment variable instead of hardcoding it.

For a full walkthrough (creating an endpoint, naming it, and verifying it on the dashboard) see the [Iroh Services quickstart](/iroh-services/quickstart).

## What's next

Today, API keys gate access to metrics and net diagnostics uploads. Future versions may support per-resource permissions and time-based access control. If your use case needs that today, [contact us](https://n0.computer/contact).
