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

# 현재 구독 조회

> 인증된 사용자의 현재 구독 상태와 세부 정보를 반환합니다.

## 개요

플랜, 과금 주기, 갱신일 등 현재 구독 정보를 반환합니다. 세션 기반 인증(JWT 액세스 토큰)이 필요합니다.

<Note>
  **서드파티 연동:** API 키 인증을 사용할 때는 대신 `GET /subscriptions/current/api`를 사용하세요.
</Note>

## 인증

<ParamField header="Authorization" type="string" required>
  JWT 액세스 토큰입니다. 형식: `Bearer YOUR_ACCESS_TOKEN`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current', {
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
  });
  const data = await response.json();
  ```

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

  response = requests.get(
      'https://api.llmgenerator.com/api/v1/subscriptions/current',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'}
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Active Subscription theme={null}
  {
    "hasSubscription": true,
    "subscription": {
      "plan": "professional",
      "status": "active",
      "billingCycle": "monthly",
      "currentPeriodStart": "2024-01-15T00:00:00Z",
      "currentPeriodEnd": "2024-02-15T00:00:00Z",
      "cancelAtPeriodEnd": false
    },
    "planDetails": {
      "id": "professional",
      "name": "Professional",
      "monthlyCredits": 3000,
      "price": 12.99,
      "features": [
        "3,000 credits/month",
        "Priority support",
        "Advanced analytics"
      ]
    }
  }
  ```

  ```json No Subscription theme={null}
  {
    "hasSubscription": false,
    "subscription": null,
    "planDetails": null
  }
  ```

  ```json Canceled (Still Active) theme={null}
  {
    "hasSubscription": true,
    "subscription": {
      "plan": "professional",
      "status": "active",
      "billingCycle": "monthly",
      "currentPeriodStart": "2024-01-15T00:00:00Z",
      "currentPeriodEnd": "2024-02-15T00:00:00Z",
      "cancelAtPeriodEnd": true
    },
    "planDetails": {
      "id": "professional",
      "name": "Professional",
      "monthlyCredits": 3000,
      "price": 12.99,
      "features": [...]
    }
  }
  ```
</ResponseExample>

## 응답 필드

<ResponseField name="hasSubscription" type="boolean">
  활성 구독 존재 여부입니다.
</ResponseField>

<ResponseField name="subscription" type="object">
  구독 세부 정보입니다(구독이 없으면 null).

  <Expandable title="속성">
    <ResponseField name="plan" type="string">
      플랜 식별자(starter, professional, business, agency)입니다.
    </ResponseField>

    <ResponseField name="status" type="string">
      현재 상태: `active`, `canceled`, `past_due`, 또는 `trialing`입니다.
    </ResponseField>

    <ResponseField name="billingCycle" type="string">
      과금 주기: `monthly` 또는 `yearly`입니다.
    </ResponseField>

    <ResponseField name="currentPeriodStart" type="string">
      현재 과금 기간 시작일(ISO 8601)입니다.
    </ResponseField>

    <ResponseField name="currentPeriodEnd" type="string">
      현재 과금 기간 종료일(ISO 8601)입니다.
    </ResponseField>

    <ResponseField name="cancelAtPeriodEnd" type="boolean">
      true이면 `currentPeriodEnd`에 구독이 종료됩니다.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="planDetails" type="object">
  전체 플랜 정보입니다(구독이 없으면 null).
</ResponseField>

## 구독 상태

| 상태         | 설명                    |
| ---------- | --------------------- |
| `active`   | 구독이 정상적으로 유효합니다       |
| `trialing` | 체험 기간입니다              |
| `past_due` | 결제 실패, 곧 일시중지될 수 있습니다 |
| `canceled` | 구독이 완전히 종료되었습니다       |

## 오류 응답

<ResponseField name="401" type="error">
  인증 실패 — 토큰이 없거나 유효하지 않습니다.
</ResponseField>

***

## GET /subscriptions/current/api

API 키 인증으로 사용자의 현재 구독 정보를 반환합니다. 서드파티 연동에 적합합니다.

### 인증

API 키 인증이 필요합니다. `Authorization` 헤더에 API 키를 넣습니다:

```
Authorization: Bearer llmgen_your_api_key_here
```

### 응답

`/subscriptions/current`와 동일합니다.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current/api \
    -H "Authorization: Bearer llmgen_your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/current/api', {
    headers: {
      'Authorization': 'Bearer llmgen_your_api_key_here'
    }
  });
  const data = await response.json();
  ```

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

  response = requests.get(
      'https://api.llmgenerator.com/api/v1/subscriptions/current/api',
      headers={'Authorization': 'Bearer llmgen_your_api_key_here'}
  )
  data = response.json()
  ```
</RequestExample>
