> ## Documentation Index
> Fetch the complete documentation index at: https://developer.qaip.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# クイックスタート

> QAIPを使って10分でチャットボットを作成する

## ログイン

[QAIPにログイン](https://developer.qaip.com/dashboard/login)して、Webサイトのチャットボットを作成する準備をしましょう。

<img src="https://mintcdn.com/qaip/JULJYwLLg6eNrOP5/images/quickstart/crawl_dashboard.png?fit=max&auto=format&n=JULJYwLLg6eNrOP5&q=85&s=b3d252940ad66eeeb548b20c0d41ef20" alt="クロールのダッシュボード" width="1913" height="977" data-path="images/quickstart/crawl_dashboard.png" />

## Webサイトをクロールする

[QAIPのドキュメント](#)をクロールしてみましょう。<br />
画面中央の「新規ジョブ作成」をクリックします。<br />
URLに「 [https://developer.qaip.com/docs](https://developer.qaip.com/docs) 」を入力し、「保存する」をクリックします。

<img src="https://mintcdn.com/qaip/UvOXSE3V3T79bHXg/images/quickstart/crawl_job.png?fit=max&auto=format&n=UvOXSE3V3T79bHXg&q=85&s=04290dcea2b04501b4f28dede45e2f49" alt="クロールのジョブ作成モーダル" width="1920" height="1765" data-path="images/quickstart/crawl_job.png" />

約3分でクロールのステータスが「Success」になります。

## 質問してみる

それでは早速質問してみましょう。サイドバーから「チャット」を選択し、以下のように入力します。

<img src="https://mintcdn.com/qaip/JULJYwLLg6eNrOP5/images/quickstart/playground_chat.png?fit=max&auto=format&n=JULJYwLLg6eNrOP5&q=85&s=a0a294eed1718a9d6363a05a69f8088b" alt="チャット画面" width="1913" height="977" data-path="images/quickstart/playground_chat.png" />

これでチャットボットが完成しました🎉

## 外部に公開する

### APIキーの発行

APIキーを発行して、チャットボットを自由に呼び出せるようにしましょう。<br />
サイドバーから「APIキー」を選択し、画面中央の「新規APIキー作成」をクリックします。

<img src="https://mintcdn.com/qaip/JULJYwLLg6eNrOP5/images/quickstart/apikey_dashboard.png?fit=max&auto=format&n=JULJYwLLg6eNrOP5&q=85&s=78b77d3b3c95a5d43541c139e353eace" alt="APIキーのダッシュボード" width="1913" height="977" data-path="images/quickstart/apikey_dashboard.png" />

名前と説明を入力し、「保存する」をクリックします。

<img src="https://mintcdn.com/qaip/JULJYwLLg6eNrOP5/images/quickstart/apikey_create.png?fit=max&auto=format&n=JULJYwLLg6eNrOP5&q=85&s=9ef3ffe4ad44f37fbd4734b35a58e07a" alt="APIキーの作成モーダル" width="1913" height="977" data-path="images/quickstart/apikey_create.png" />

APIキーが作成されるので、コピーしておきます。

<img src="https://mintcdn.com/qaip/JULJYwLLg6eNrOP5/images/quickstart/apikey_result.png?fit=max&auto=format&n=JULJYwLLg6eNrOP5&q=85&s=8c2fad504c8504cc9586e7857158e2f8" alt="APIキーの作成結果" width="1913" height="977" data-path="images/quickstart/apikey_result.png" />

### APIを呼び出す

作成したチャットボットを呼び出す方法を説明します。現在は下記の2つの方法があります。

1. QAIP Python SDKを使用する
2. 直接APIを呼び出す

#### 準備：環境変数の設定

APIキーは環境変数として設定することをお勧めします：

```bash theme={null}
# Linux/Mac
export QAIP_API_KEY="your-api-key-here"

# Windows
set QAIP_API_KEY=your-api-key-here
```

<Tabs>
  <Tab title="Python SDK" icon="python">
    ### インストール

    QAIPのAPIを呼び出すためにSDKをインストールします：

    ```bash theme={null}
    pip install qaip
    ```

    ### サンプルスクリプト

    ```python theme={null}
    from qaip import Qaip
    client = Qaip()

    result = client.completion(
        messages=[{"role": "user", "content": "QAIPの主な機能について教えてください"}],
        citation=True,
    )

    for choice in result.choices:
        print(f"Assistant: {choice.message.content}")
        if choice.citations:
            print("\n引用元:")
            for i, citation in enumerate(choice.citations):
                print(f"- {i+1}: {citation.url}")
    ```
  </Tab>

  <Tab title="curl" icon="code">
    ライブラリに依存せずにQAIPのAPIを利用することができます。

    ```bash theme={null}
    curl -X POST https://developer.qaip.com/api/v1/completions \
      -H "Content-Type: application/json" \
      -H "x-api-key: $QAIP_API_KEY" \
      -d '{
        "messages": [
          { "role": "user", "content": "QAIPの主な機能について教えてください" }
        ],
        "citation": true
      }'
    ```
  </Tab>
</Tabs>
