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

# 生成ジョブの状態確認

> 生成ジョブの状態を取得するエンドポイントです。

## GET /generate/{jobId}

生成ジョブの現在の状態を返します。処理中ジョブの進捗確認や、完了済みジョブの詳細取得に利用します。

### パスパラメーター

<ParamField path="jobId" type="string" required>
  確認する生成ジョブの ID。
</ParamField>

### レスポンス

<ResponseField name="id" type="string">
  生成ジョブの一意な識別子。
</ResponseField>

<ResponseField name="siteId" type="string">
  生成対象サイトの ID。
</ResponseField>

<ResponseField name="status" type="string">
  現在の状態: `pending`、`processing`、`completed`、`failed`。
</ResponseField>

<ResponseField name="progress" type="number">
  進捗率（0〜100）。
</ResponseField>

<ResponseField name="url" type="string">
  ファイルを生成した対象 URL。
</ResponseField>

<ResponseField name="options" type="object">
  使用した生成オプション。

  <Expandable title="options のプロパティ">
    <ResponseField name="maxUrls" type="number">
      処理した URL の上限。
    </ResponseField>

    <ResponseField name="showFullText" type="boolean">
      全文を含めたかどうか。
    </ResponseField>

    <ResponseField name="generationMethod" type="string">
      方式: `simple` または `enhanced`。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="fileUrl" type="string">
  生成ファイルにアクセスする URL（完了時）。
</ResponseField>

<ResponseField name="fullTextUrl" type="string">
  全文版にアクセスする URL（完了時）。
</ResponseField>

<ResponseField name="error" type="string">
  ジョブ失敗時のエラーメッセージ。
</ResponseField>

<ResponseField name="createdAt" type="string">
  ジョブ作成日時の ISO 8601 タイムスタンプ。
</ResponseField>

<ResponseField name="completedAt" type="string">
  ジョブ完了日時の ISO 8601 タイムスタンプ。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.llmgenerator.com/api/v1/generate/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/generate/550e8400-e29b-41d4-a716-446655440000',
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const status = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 処理中 theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "siteId": "site_abc123",
    "status": "processing",
    "progress": 45,
    "url": "https://example.com",
    "options": {
      "maxUrls": 50,
      "showFullText": true,
      "generationMethod": "enhanced"
    },
    "fileUrl": null,
    "fullTextUrl": null,
    "error": null,
    "createdAt": "2026-01-20T10:00:00.000Z",
    "completedAt": null
  }
  ```

  ```json 完了 theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "siteId": "site_abc123",
    "status": "completed",
    "progress": 100,
    "url": "https://example.com",
    "options": {
      "maxUrls": 50,
      "showFullText": true,
      "generationMethod": "enhanced"
    },
    "fileUrl": "https://api.llmgenerator.com/api/v1/file/site_abc123",
    "fullTextUrl": "https://api.llmgenerator.com/api/v1/file/site_abc123?full=true",
    "error": null,
    "createdAt": "2026-01-20T10:00:00.000Z",
    "completedAt": "2026-01-20T10:05:00.000Z"
  }
  ```

  ```json 失敗 theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "siteId": "site_abc123",
    "status": "failed",
    "progress": 0,
    "url": "https://example.com",
    "options": {
      "maxUrls": 50,
      "showFullText": false,
      "generationMethod": "simple"
    },
    "fileUrl": null,
    "fullTextUrl": null,
    "error": "Failed to fetch sitemap: 404 Not Found",
    "createdAt": "2026-01-20T10:00:00.000Z",
    "completedAt": "2026-01-20T10:00:30.000Z"
  }
  ```
</ResponseExample>
