# ドキュメントに API リファレンスを挿入する

GitBook を使うと、OpenAPI 仕様に含まれるエンドポイントに関連するページを自動生成できます。これらのページには OpenAPI の操作ブロックが含まれ、あなたや訪問者がエンドポイントをテストしたり、仕様に記載された情報に基づいてさらに詳しく調べたりできます。

{% hint style="success" %}
仕様から追加したエンドポイントは、仕様が更新されるたびに引き続き更新されます。詳しくは [仕様を更新する](/docs/documentation/ja-gitbook-documentation/api-references/openapi/add-an-openapi-specification.md#update-your-specification) セクションを参照してください。
{% endhint %}

### 仕様から OpenAPI ページを自動的に作成する

OpenAPI 仕様を [追加したら](/docs/documentation/ja-gitbook-documentation/api-references/openapi/add-an-openapi-specification.md)、次のものを挿入することでエンドポイントページを生成できます **OpenAPI リファレンス** Space の目次に。

<figure><img src="/files/286270a58037be7f7e123fdd733459fed8d6888c" alt="A GitBook screenshot showing how to insert API references into the table of contents of a space"><figcaption><p>API リファレンスを Space の目次に挿入します。</p></figcaption></figure>

{% stepper %}
{% step %}
**OpenAPI からページを生成する**

エンドポイントページを生成したいスペースで、 **新規追加...** ボタンをスペースの下部にある [目次](/docs/documentation/ja-gitbook-documentation/rissu/gitbook-ui.md#table-of-contents).

ここから **OpenAPI リファレンス**.
{% endstep %}

{% step %}
**OpenAPI 仕様を選択**

以前アップロードした OpenAPI 仕様を選択し、 **挿入** をクリックして、エンドポイントをスペースに自動的に追加します。必要に応じて、すべての OpenAPI スキーマを参照するモデルページを追加することもできます。
{% endstep %}

{% step %}
**API 操作を管理する**

GitBook は、OpenAPI 仕様とその定義内で設定されたタグに基づいて、ページを自動生成します。

次へ移動します [API リファレンスの構成](/docs/documentation/ja-gitbook-documentation/api-references/guides/structuring-your-api-reference.md) を参照して、OpenAPI 仕様を通じて操作を整理する方法について詳しく学んでください。
{% endstep %}
{% endstepper %}

### 個別の OpenAPI ブロックを追加する

または、仕様内の OpenAPI 操作やスキーマを、ドキュメント内の各ページに個別に追加することもできます。

{% stepper %}
{% step %}
**新しい OpenAPI ブロックを追加する**

次を押してブロックセレクターを開きます **/**、OpenAPI を検索します。
{% endstep %}

{% step %}
**OpenAPI 仕様を選択**

以前アップロードした OpenAPI 仕様を選択し、 **続行** して、使用したいエンドポイントを選択します。
{% endstep %}

{% step %}
**挿入したい操作またはスキーマを選択する**

ドキュメントに挿入したい操作とスキーマを選択し、 **挿入**.
{% endstep %}
{% endstepper %}


---

# 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://gitbook.com/docs/documentation/ja-gitbook-documentation/api-references/openapi/insert-api-reference-in-your-docs.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.
