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

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

OpenAPI スペックから完全な API リファレンスを挿入するか、個別の操作やスキーマを選択します

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

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

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

～した後で [OpenAPI仕様を追加した](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/add-an-openapi-specification.md)、エンドポイントページを生成するには、1つの **OpenAPI リファレンス** セクションの目次に。

<figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FYy8gCqxfaO4xjv2eqiL5%2Fcreate_api_pages%402x.png?alt=media&amp;token=62b8386b-9fea-4233-b961-b6a1e582411e" 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 リファレンス**.
{% endstep %}

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

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

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

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

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

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

に移動します [OpenAPI レイアウト](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/guides/openapi-layouts.md) レイアウトを比較するには、または [API リファレンスの構成](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/guides/structuring-your-api-reference.md) タグでページを整理するには。
{% endstep %}
{% endstepper %}

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

代わりに、仕様内のOpenAPIの操作やスキーマを、ドキュメント全体の各ページに個別に追加できます。

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

を押してブロックセレクターを開き、 **/**&#x4F;penAPIを検索します。
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
