> 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/kontentsuwo/openapi/insert-api-reference-in-your-docs.md).

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

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

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

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

〜した後で [OpenAPI仕様を追加した](/docs/documentation/ja-gitbook-documentation/kontentsuwo/openapi/add-an-openapi-specification.md)、1つの **OpenAPI Reference** セクションの目次に

<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/rifarensu/gitbook-ui.md#table-of-contents).

ここから、次をクリックします。 **OpenAPI Reference**.
{% endstep %}

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

以前アップロードしたOpenAPI仕様を選択します。次に、 **ページ構成**:

* **タグごとに1ページ**
* **操作ごとに1ページ**

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

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

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

次へ移動します [OpenAPIレイアウト](/docs/documentation/ja-gitbook-documentation/kontentsuwo/openapi/guides/openapi-layouts.md) レイアウトを比較するか、 [API リファレンスの構造化](/docs/documentation/ja-gitbook-documentation/kontentsuwo/openapi/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/kontentsuwo/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.
