> For the complete documentation index, see [llms.txt](https://api.docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.docs.blockbrain.ai/de/erste-schritte/getting-started/api-keys.md).

# Einen API-Schlüssel erstellen

## Zugriff erforderlich

Sie benötigen ein Konto mit Administratorrechten, um API-Schlüssel in der Knowledge Bots UI zu generieren.

## So erhalten Sie Ihren API-Schlüssel

* Melden Sie sich an bei **Knowledge Bots UI** unter `https://<your-org>.kb.theblockbrain.ai` mit Ihren Zugangsdaten (ersetzen Sie `<your-org>` durch die tatsächliche Domain Ihrer Organisation)
* Gehen Sie in der Knowledge Bots UI zu **Admin -> API Keys**
* Klicken Sie auf **API-Schlüssel generieren** (oben rechts)

![API-Keys-Tab](/files/630450917ff25fcd66c9f7946c9efdc3da1becc7)

* Geben Sie den Namen Ihres API-Schlüssels, eine Beschreibung (optional) und das Ablaufdatum ein. Wenn Sie nicht möchten, dass Ihr API-Schlüssel abläuft, deaktivieren Sie den Schalter **Ablaufdatum** .

![API-Keys-Konfiguration](/files/ec904a958729631ed681b68983fa5a55affc413b)

* Klicken Sie auf **Speichern**
* Sie können Ihre vorhandenen API-Schlüssel sehen, wenn Sie den API-Keys-Tab erneut aufrufen.
* Klicken Sie einfach auf Ihren neu erstellten API-Schlüssel, um ihn in die Zwischenablage zu kopieren.

![API-Schlüssel kopieren](/files/4f8cdd975c1813ba560ff4810970051e925dffd1)

{% hint style="warning" %}
Ein API-Schlüssel handelt in Ihrem Namen. Mit anderen Worten: Alle über diese API erstellten Ressourcen gehören Ihnen und sind für andere in Ihrer Organisation möglicherweise nicht sofort zugänglich.
{% endhint %}

## API-Schlüssel verwenden

Fügen Sie Ihren API-Schlüssel zu Ihrer Anfrage hinzu `Authorization` Header als `Bearer` Token.

```
Headers: {​
      "Authorization": "Bearer <api_key>"​
    },
```

## API-Schlüssel überprüfen

Prüfen Sie den `/user/me` API-Endpunkt, um zu sehen, ob Ihr API-Schlüssel funktioniert.

Wenn der Schlüssel aktiv ist, sollte der API-Endpunkt den Status 200 und den Inhalt "ok" zurückgeben.

Verwenden Sie die folgende Basis-URL.

```bash
https://blocky.theblockbrain.ai/user/me
```

## GET /user/me

> Getuserinfo

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"paths":{"/user/me":{"get":{"tags":["user"],"summary":"Getuserinfo","operationId":"getUserInfo_user_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Getuserinfo User Me Get"}}}}}}}}}
```

***

## Nächste Schritte

Mit Ihrem neuen validierten API-Schlüssel können wir ihn jetzt verwenden, indem wir [einen neuen Knowledge Bot erstellen!](/de/erste-schritte/getting-started/create-knowledge-bot/create-knowledge-bot.md)

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.docs.blockbrain.ai/de/erste-schritte/getting-started/api-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
