> ## 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.

# llms.txt 생성

> 지정한 URL에 대해 llms.txt 파일을 생성하는 엔드포인트입니다.

## POST /generate

`llms.txt` 생성을 시작합니다. 사용자 플랜에 따라 `simple`과 `enhanced` 방식을 지원합니다.

<Note>
  Enhanced 방식은 AI로 제목·설명 품질을 높입니다. 크레딧은 Simple 대비 2배 소모됩니다.
</Note>

### 요청 본문

<ParamField body="url" type="string" required>
  파일을 만들 웹사이트 URL입니다. http/https 프로토콜이 있는 유효한 URL이어야 합니다.
</ParamField>

<ParamField body="options" type="object">
  생성 옵션 객체입니다.

  <Expandable title="options 속성">
    <ParamField body="maxUrls" type="number" default="50">
      포함할 최대 URL 수입니다. 범위: 1–1000.
    </ParamField>

    <ParamField body="showFullText" type="boolean" default="false">
      각 페이지 전체 텍스트를 결과에 포함할지 여부입니다.
    </ParamField>

    <ParamField body="includeModificationDate" type="boolean" default="false">
      URL별 마지막 수정일을 포함할지 여부입니다.
    </ParamField>

    <ParamField body="generationMethod" type="string" default="enhanced">
      `simple`(메타데이터 기반) 또는 `enhanced`(AI로 제목·설명 개선)입니다.
    </ParamField>

    <ParamField body="cacheAge" type="number" default="3600000">
      캐시 유지 시간(밀리초)입니다. 기본 1시간으로 스크레이프를 빠르게 할 수 있습니다.
    </ParamField>
  </Expandable>
</ParamField>

### 응답

<ResponseField name="jobId" type="string">
  생성 작업 고유 식별자입니다.
</ResponseField>

<ResponseField name="status" type="string">
  작업 상태: `queued`, `processing`, `completed`, 또는 `failed`입니다.
</ResponseField>

<ResponseField name="progress" type="number">
  진행률(0–100)입니다.
</ResponseField>

<ResponseField name="message" type="string">
  사람이 읽을 수 있는 상태 메시지입니다.
</ResponseField>

<ResponseField name="fileUrl" type="string">
  생성된 `llms.txt`에 접근할 수 있는 URL입니다.
</ResponseField>

<ResponseField name="fullTextUrl" type="string">
  전체 텍스트 버전 `llms.txt` URL입니다(`showFullText` 활성 시).
</ResponseField>

<ResponseField name="siteId" type="string">
  이번 생성으로 만들거나 갱신된 사이트 ID입니다.
</ResponseField>

<ResponseField name="creditsUsed" type="number">
  이번 생성에 차감된 크레딧 수입니다.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/generate \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
          "url": "https://www.example.com",
          "options": {
            "maxUrls": 25,
            "generationMethod": "enhanced",
            "showFullText": true
          }
        }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/generate', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://www.example.com',
      options: {
        maxUrls: 25,
        generationMethod: 'enhanced'
      }
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.llmgenerator.com/api/v1/generate',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'url': 'https://www.example.com',
          'options': {
              'maxUrls': 25,
              'generationMethod': 'enhanced'
          }
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "jobId": "550e8400-e29b-41d4-a716-446655440000",
    "status": "completed",
    "progress": 100,
    "message": "File generated successfully",
    "fileUrl": "https://api.llmgenerator.com/api/v1/file/site_xxxxx",
    "fullTextUrl": "https://api.llmgenerator.com/api/v1/file/site_xxxxx?full=true",
    "siteId": "site_xxxxx",
    "creditsUsed": 50
  }
  ```

  ```json Insufficient Credits (402) theme={null}
  {
    "message": "Insufficient credits. Required: 50, Available: 10. Please purchase more credits to continue."
  }
  ```
</ResponseExample>
