> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/api-references/openapi/insert-api-reference-in-your-docs.md).

# ドキュメントに 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 リファレンス** をセクションの目次に挿入します。

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

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

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

ここから、次をクリックします: **OpenAPI リファレンス**.
{% endstep %}

{% step %}
**OpenAPI 仕様を選択してください**

以前にアップロードしたOpenAPI仕様を選択してください。次に、 **ページ構成**:

* **タグごとに1ページ**
* **オペレーションごとに1ページ**

モデルページとダウンロードリンクを追加することもできます。次をクリックします: **挿入** してリファレンスを生成します。
{% endstep %}

{% step %}
**API オペレーションを管理する**

GitBookは、OpenAPI仕様とその定義内で設定されたタグに基づいてページを自動生成します。次を選択すると **オペレーションごとに1ページ**、GitBookは生成されたオペレーションページをタグごとにグループ化します。

次を参照してください: [OpenAPI レイアウト](/docs/documentation/ja-gitbook-documentation/api-references/guides/openapi-layouts.md) レイアウトを比較するには、または [API リファレンスの構成](/docs/documentation/ja-gitbook-documentation/api-references/guides/structuring-your-api-reference.md) タグを使ってページを整理するには。
{% endstep %}
{% endstepper %}

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

あるいは、仕様内の OpenAPI オペレーションやスキーマを、ドキュメント全体のページに個別に追加することもできます。

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

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

{% step %}
**OpenAPI 仕様を選択してください**

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

{% step %}
**挿入したいオペレーションまたはスキーマを選択します**

ドキュメントに挿入したいオペレーションとスキーマを選び、次をクリックします **挿入**.
{% endstep %}
{% endstepper %}


---

# 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, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/api-references/openapi/insert-api-reference-in-your-docs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
