> ## Documentation Index
> Fetch the complete documentation index at: https://number0-improve-contact.mintlify.site/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 two endpoints never need authorization — but the resources in your project belong to you. Your API key is what lets an endpoint push data into your project and connect to your project's dedicated relays.

## 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
* Connecting to your project's [dedicated relays](/iroh-services/relays/managed), which require authentication by default

API keys are **not** required for:

* Connecting through the public 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-improve-contact/C_2EI7fklV1apm_M/images/new-project.png?fit=max&auto=format&n=C_2EI7fklV1apm_M&q=85&s=6ed4e78b6c3bca3734cf2d1af1b55bca" 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-improve-contact/C_2EI7fklV1apm_M/images/create-api-key.png?fit=max&auto=format&n=C_2EI7fklV1apm_M&q=85&s=585774e39c69a7864f76b3822a27f145" alt="Create API Key" width="1284" height="421" data-path="images/create-api-key.png" />

<img src="https://mintcdn.com/number0-improve-contact/C_2EI7fklV1apm_M/images/see-api-key.png?fit=max&auto=format&n=C_2EI7fklV1apm_M&q=85&s=657bc221e0cfe1698761a70e486b38d6" 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 metrics and net diagnostics uploads and access to your
dedicated relays. 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).
