# API キーを発行・管理する

API キーは、アプリケーションから Citadel Radar API を利用する際に使用する認証情報です。

{% hint style="success" %}
Citadel Radar では、API キーをアプリケーション単位で発行します。アプリケーションごとに API キーを分けることで、どのアプリケーションからログが送信されているかを管理しやすくなり、不要になったキーの無効化や、キー更新時の影響範囲を限定することができます。
{% endhint %}

API 仕様に関しては、 [API エンドポイント](/developer-guide/api-endpoints.md) ページを参照してください。

### API キーを発行する前に

API キーは、登録済みのアプリケーションに対して発行します。

まだ対象のアプリケーションを登録していない場合は、先に [新しくアプリケーションを登録する](/operations-guide/new-application.md) を参照してください。

また、API キーはアプリケーションから Citadel Radar に入力ログや出力ログを送信する際に使用します。発行後は、アプリケーション側の環境変数やシークレット管理ツールなど、安全な場所に設定してください。

### API キーを発行する

Nodes 画面から、対象のアプリケーションを選択し、アプリケーションの設定画面に遷移してください。

遷移後、API キーカードの `設定を開く` を選択してください。

<figure><img src="/files/wx9oVTqI5RRI4xkDhKRD" alt="" width="563"><figcaption></figcaption></figure>

新しくAPI キーを作成するためには、画面右下の `新しいキーを作成` を選択して下さい。

API キーの名前を設定後、`新しいキーを作成` を選択し、表示されたキーを記録・保管してください。

<figure><img src="/files/Z5P1Dcf0jVfneaRVaebV" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="warning" %}
API キーは発行時にのみ表示されます。ページを閉じると、同じ API キーを再表示することはできません。必ず発行時にコピーし、安全な場所に保管してください。
{% endhint %}

{% hint style="success" %}
現在、API キーはログ送信用の POST API に対する認証情報として使用します。そのため、API キーごとに権限を設定する機能はありません。
{% endhint %}

#### Swagger Playground でリクエストを試す

Nodes 画面から、`API ドキュメントを開く` を選択すると、Swagger Playground の画面に遷移します。

Swagger Playground を利用して、Citadel Radar API のリクエスト形式やレスポンス形式を確認できます。発行した API キーを使って、ログ送信用の POST API を試すこともできます。

<figure><img src="/files/qAlNGkAvnUIODqnBUQut" alt="" width="563"><figcaption></figcaption></figure>

### API キーを管理する

発行された API キーは、対象アプリケーションのAPI キーページから確認できます。

API キーは複数作成でき、削除アイコンから削除することもできます。


---

# Agent Instructions: 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://docs.radar.citadel-ai.com/developer-guide/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.
