跳转到主要内容
GET
/
subscriptions
/
current
curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "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"
    ]
  }
}

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 访问令牌。
**第三方集成:**请改用 GET /subscriptions/current/api 并以 API Key 鉴权。

认证

Authorization
string
必填
JWT 访问令牌。格式:Bearer YOUR_ACCESS_TOKEN
curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "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"
    ]
  }
}

响应字段

hasSubscription
boolean
用户是否拥有有效订阅。
subscription
object
订阅详情(无订阅时为 null)。
planDetails
object
完整套餐信息(无订阅时为 null)。

订阅状态

状态说明
active订阅有效且账务正常
trialing处于试用期内
past_due扣款失败,可能即将暂停
canceled订阅已完全取消

错误响应

401
error
未授权——令牌无效或缺失。

GET /subscriptions/current/api

使用 API Key 返回当前订阅信息,适合第三方集成。

认证

需要 API Key,在 Authorization 请求头中携带:
Authorization: Bearer llmgen_your_api_key_here

响应

/subscriptions/current 相同。
curl -X GET https://api.llmgenerator.com/api/v1/subscriptions/current/api \
  -H "Authorization: Bearer llmgen_your_api_key_here"