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

# Aktuelles Abonnement abrufen

> Status und Details des aktuellen Abonnements des authentifizierten Nutzers.

## Überblick

Liefert Informationen zum aktuellen Abonnement inklusive Tarif, Abrechnungszyklus und Verlängerungsdaten. Erfordert Sitzungsauthentifizierung (JWT-Access-Token).

<Note>
  **Für Drittanbieter-Integrationen:** Verwenden Sie `GET /subscriptions/current/api` mit API-Schlüssel-Authentifizierung.
</Note>

## Authentifizierung

<ParamField header="Authorization" type="string" required>
  JWT-Access-Token. Format: `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 Aktives Abonnement 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 Kein Abonnement theme={null}
  {
    "hasSubscription": false,
    "subscription": null,
    "planDetails": null
  }
  ```

  ```json Gekündigt (noch aktiv) 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>

## Antwortfelder

<ResponseField name="hasSubscription" type="boolean">
  Ob ein aktives Abonnement besteht.
</ResponseField>

<ResponseField name="subscription" type="object">
  Abonnementdetails (null ohne Abonnement).

  <Expandable title="Eigenschaften">
    <ResponseField name="plan" type="string">
      Tarifkennung (starter, professional, business, agency).
    </ResponseField>

    <ResponseField name="status" type="string">
      Aktueller Status: `active`, `canceled`, `past_due` oder `trialing`.
    </ResponseField>

    <ResponseField name="billingCycle" type="string">
      Abrechnungsintervall: `monthly` oder `yearly`.
    </ResponseField>

    <ResponseField name="currentPeriodStart" type="string">
      Beginn der aktuellen Abrechnungsperiode (ISO 8601).
    </ResponseField>

    <ResponseField name="currentPeriodEnd" type="string">
      Ende der aktuellen Abrechnungsperiode (ISO 8601).
    </ResponseField>

    <ResponseField name="cancelAtPeriodEnd" type="boolean">
      Bei true endet das Abonnement zum Zeitpunkt `currentPeriodEnd`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="planDetails" type="object">
  Vollständige Tarifinformationen (null ohne Abonnement).
</ResponseField>

## Abonnement-Status

| Status     | Beschreibung                                  |
| ---------- | --------------------------------------------- |
| `active`   | Abonnement ist aktiv und in Ordnung           |
| `trialing` | Nutzer befindet sich in der Testphase         |
| `past_due` | Zahlung fehlgeschlagen, Suspendierung möglich |
| `canceled` | Abonnement wurde vollständig beendet          |

## Fehlerantworten

<ResponseField name="401" type="error">
  Nicht autorisiert – Ungültiges oder fehlendes Token.
</ResponseField>

***

## GET /subscriptions/current/api

Liefert das aktuelle Abonnement mit API-Schlüssel-Authentifizierung. Geeignet für Drittanbieter-Integrationen.

### Authentifizierung

API-Schlüssel erforderlich. Übergeben Sie ihn im Header `Authorization`:

```
Authorization: Bearer llmgen_your_api_key_here
```

### Antwort

Wie bei `/subscriptions/current` oben.

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